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:
f0733c1
)
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
diff --git
a/builtin/cat-file.c
b/builtin/cat-file.c
index
1890d7a
..
9af863e
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;
}