Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
merge-blobs.c: fix a memleak
author
Stefan Beller
<sbeller@google.com>
Sat, 21 Mar 2015 00:28:03 +0000
(17:28 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 23 Mar 2015 18:12:58 +0000
(11:12 -0700)
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-blobs.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
f0b1f1e
)
diff --git
a/merge-blobs.c
b/merge-blobs.c
index 57211bccb7d0a5aad8538906bcb2f4ad2900f008..7abb894c684d1ff7bc26b30ffa41597451750f20 100644
(file)
--- 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;