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>
This commit is contained in:
Johannes Schindelin 2017-05-04 15:56:17 +02:00 committed by Junio C Hamano
parent f0733c13ed
commit 05c2b7ba49

View file

@ -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;
}