Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
cat-file: fix memory leak
author
Johannes Schindelin
<johannes.schindelin@gmx.de>
Thu, 4 May 2017 13:56:17 +0000
(15:56 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 8 May 2017 03:18:19 +0000
(12:18 +0900)
Discovered by Coverity.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/cat-file.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
f0733c1
)
diff --git
a/builtin/cat-file.c
b/builtin/cat-file.c
index 1890d7a6390dcae719af33ce5cb59e74832a80e8..9af863e7915d21aee7af3cb4d01ebbad2efbcb59 100644
(file)
--- a/
builtin/cat-file.c
+++ b/
builtin/cat-file.c
@@
-165,6
+165,7
@@
static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
die("git cat-file %s: bad file", obj_name);
write_or_die(1, buf, size);
+ free(buf);
return 0;
}