From d687839c29624de4b00ac22a6d8160172b357e14 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Fri, 20 Mar 2015 17:28:03 -0700 Subject: [PATCH] merge-blobs.c: fix a memleak Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- merge-blobs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/merge-blobs.c b/merge-blobs.c index 57211bccb..7abb894c6 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; -- 2.11.0