cat-file: fix memory leak

Discovered by Coverity. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed May 4, 2017 at 15:56 UTC 05c2b7ba49e36a6beff30204948dba79451c4233
1 file changed +1
builtin/cat-file.c
+1
@@ -165,6 +165,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
165 die("git cat-file %s: bad file", obj_name);
166
167 write_or_die(1, buf, size);
168 + free(buf);
169 return 0;
170 }
171