merge-blobs.c: fix a memleak
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
f0b1f1ece7
commit
d687839c29
@ -14,8 +14,10 @@ static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
|
|||||||
buf = read_sha1_file(obj->object.sha1, &type, &size);
|
buf = read_sha1_file(obj->object.sha1, &type, &size);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return -1;
|
return -1;
|
||||||
if (type != OBJ_BLOB)
|
if (type != OBJ_BLOB) {
|
||||||
|
free(buf);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
f->ptr = buf;
|
f->ptr = buf;
|
||||||
f->size = size;
|
f->size = size;
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user