summaryrefslogtreecommitdiff
path: root/merge-blobs.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-03-27 13:02:32 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-03-27 13:02:32 -0700
commit553c622b685f0a7a83c77617377f08019d76c682 (patch)
tree59a6165ca81d3355fe9279a929563fd1c0b91d55 /merge-blobs.c
parentGit 2.4.0-rc0 (diff)
parenthttp: release the memory of a http pack request as well (diff)
downloadtgif-553c622b685f0a7a83c77617377f08019d76c682.tar.xz
Merge branch 'sb/leaks'
* sb/leaks: http: release the memory of a http pack request as well read-cache: fix memleak add_to_index(): free unused cache-entry commit.c: fix a memory leak http-push: remove unneeded cleanup merge-recursive: fix memleaks merge-blobs.c: fix a memleak builtin/apply.c: fix a memleak update-index: fix a memleak read-cache: free cache entry in add_to_index in case of early return
Diffstat (limited to 'merge-blobs.c')
-rw-r--r--merge-blobs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/merge-blobs.c b/merge-blobs.c
index 57211bccb7..7abb894c68 100644
--- 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;