Skip to content

Commit d687839

Browse files
stefanbellergitster
authored andcommitted
merge-blobs.c: fix a memleak
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f0b1f1e commit d687839

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

merge-blobs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
1414
buf = read_sha1_file(obj->object.sha1, &type, &size);
1515
if (!buf)
1616
return -1;
17-
if (type != OBJ_BLOB)
17+
if (type != OBJ_BLOB) {
18+
free(buf);
1819
return -1;
20+
}
1921
f->ptr = buf;
2022
f->size = size;
2123
return 0;

0 commit comments

Comments
 (0)