Skip to content

Commit 05c2b7b

Browse files
dschogitster
authored andcommitted
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>
1 parent f0733c1 commit 05c2b7b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

builtin/cat-file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
165165
die("git cat-file %s: bad file", obj_name);
166166

167167
write_or_die(1, buf, size);
168+
free(buf);
168169
return 0;
169170
}
170171

0 commit comments

Comments
 (0)