Skip to content

Commit 3e8f470

Browse files
committed
Free the correct reference if an error occurrs.
It should be the `new` pointer, not the `old` one.
1 parent 75b2787 commit 3e8f470

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libgit2/refdb_fs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,7 @@ static int refdb_fs_backend__rename(
17881788
}
17891789

17901790
if ((error = loose_lock(&file, backend, new_name)) < 0) {
1791-
git_reference_free(old);
1791+
git_reference_free(new);
17921792
return error;
17931793
}
17941794

0 commit comments

Comments
 (0)