OSDN Git Service
(root)
/
git-core
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0b1f1e
)
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
diff --git
a/merge-blobs.c
b/merge-blobs.c
index
57211bc
..
7abb894
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;