mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
object-name: fix leaking symlink paths in object context
The object context may be populated with symlink contents when reading a symlink, but the associated strbuf doesn't ever get released when releasing the object context, causing a memory leak. Plug it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
aa9ef614dc
commit
9ddd5f755d
@@ -1765,6 +1765,7 @@ int strbuf_check_branch_ref(struct strbuf *sb, const char *name)
|
||||
void object_context_release(struct object_context *ctx)
|
||||
{
|
||||
free(ctx->path);
|
||||
strbuf_release(&ctx->symlink_path);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
test_description='git cat-file'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_cmdmode_usage () {
|
||||
|
||||
Reference in New Issue
Block a user