From: Andy Green Date: Tue, 19 Jun 2018 09:02:07 +0000 (+0800) Subject: ui-blame: free read_sha1_file() buffer after use X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/b759189574971eabf98aee73b4e4e4c604e21a94 ui-blame: free read_sha1_file() buffer after use Signed-off-by: Andy Green Signed-off-by: John Keeping --- 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,