From b759189574971eabf98aee73b4e4e4c604e21a94 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 19 Jun 2018 17:02:07 +0800 Subject: ui-blame: free read_sha1_file() buffer after use Signed-off-by: Andy Green Signed-off-by: John Keeping --- ui-blame.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui-blame.c b/ui-blame.c index 17e2d60..b118a81 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -154,7 +154,7 @@ static void print_object(const unsigned char *sha1, const char *path, htmlf("
blob size (%ldKB)" " exceeds display size limit (%dKB).
", size / 1024, ctx.cfg.max_blob_size); - return; + goto cleanup; } html("\n\n"); @@ -213,6 +213,9 @@ static void print_object(const unsigned char *sha1, const char *path, html("\n
\n"); cgit_print_layout_end(); + +cleanup: + free(buf); } static int walk_tree(const unsigned char *sha1, struct strbuf *base, -- cgit v1.2.3-70-g09d2