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:
Patrick Steinhardt
2024-08-14 08:52:00 +02:00
committed by Junio C Hamano
parent aa9ef614dc
commit 9ddd5f755d
2 changed files with 2 additions and 0 deletions

View File

@ -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);
}
/*