From: Stefan Beller Date: Sat, 21 Mar 2015 00:28:03 +0000 (-0700) Subject: merge-blobs.c: fix a memleak X-Git-Tag: v2.4.0-rc1~9^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d687839c29624de4b00ac22a6d8160172b357e14;p=git merge-blobs.c: fix a memleak Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- diff --git a/merge-blobs.c b/merge-blobs.c index 57211bccb7..7abb894c68 100644 --- a/merge-blobs.c +++ b/merge-blobs.c @@ -14,8 +14,10 @@ static int fill_mmfile_blob(mmfile_t *f, struct blob *obj) buf = read_sha1_file(obj->object.sha1, &type, &size); if (!buf) return -1; - if (type != OBJ_BLOB) + if (type != OBJ_BLOB) { + free(buf); return -1; + } f->ptr = buf; f->size = size; return 0;