Skip to content

Commit 1d683c1

Browse files
author
Edward Thomson
authored
Merge pull request libgit2#4006 from libgit2/cmn/compress-buf-free
Plug a leak in the refs compressor
2 parents a39f18a + 21e0fc3 commit 1d683c1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/refdb_fs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ static int packed_remove_loose(refdb_fs_backend *backend)
927927
continue;
928928

929929
if (error < 0) {
930+
git_buf_free(&ref_content);
930931
giterr_set(GITERR_REFERENCE, "failed to lock loose reference '%s'", ref->name);
931932
return error;
932933
}
@@ -957,6 +958,7 @@ static int packed_remove_loose(refdb_fs_backend *backend)
957958
p_unlink(lock.path_original);
958959
}
959960

961+
git_buf_free(&ref_content);
960962
git_filebuf_cleanup(&lock);
961963
return 0;
962964
}

0 commit comments

Comments
 (0)