aboutsummaryrefslogtreecommitdiffstats
path: root/object-file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-07-02 09:59:01 -0700
committerJunio C Hamano <gitster@pobox.com>2024-07-02 09:59:01 -0700
commitca349c387b0c07ad4dcafabc4b07d1910aab9995 (patch)
treecb83c7e66a956cac7cf7aa2cad685fd4ac1dd3f9 /object-file.c
parentca463101c8978910c45d9a053dc1af07d42a8664 (diff)
parent493fdae0464282fbac99f60d94bfaabf5559c9ff (diff)
downloadgit-ca349c387b0c07ad4dcafabc4b07d1910aab9995.tar.gz
Merge branch 'ew/object-convert-leakfix'
Leakfix. * ew/object-convert-leakfix: object-file: fix leak on conversion failure
Diffstat (limited to 'object-file.c')
-rw-r--r--object-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/object-file.c b/object-file.c
index 9e4b8314c0..065103be3e 100644
--- a/object-file.c
+++ b/object-file.c
@@ -1708,9 +1708,9 @@ static int oid_object_info_convert(struct repository *r,
ret = convert_object_file(&outbuf,
the_hash_algo, input_algo,
content, size, type, !do_die);
+ free(content);
if (ret == -1)
return -1;
- free(content);
size = outbuf.len;
content = strbuf_detach(&outbuf, NULL);
}