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:
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);
|
||||
if (!buf)
|
||||
return -1;
|
||||
if (type != OBJ_BLOB)
|
||||
if (type != OBJ_BLOB) {
|
||||
free(buf);
|
||||
return -1;
|
||||
}
|
||||
f->ptr = buf;
|
||||
f->size = size;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user