From mboxrd@z Thu Jan 1 00:00:00 1970 From: andy at warmcat.com (Andy Green) Date: Mon, 18 Jun 2018 10:57:55 +0800 Subject: [PATCH v2 08/15] ui-blame: free read_sha1_file() buffer after use In-Reply-To: <152928998685.10419.7869045561776063625.stgit@mail.warmcat.com> References: <152928998685.10419.7869045561776063625.stgit@mail.warmcat.com> Message-ID: <152929067544.10419.7623088006640993240.stgit@mail.warmcat.com> Signed-off-by: Andy Green --- ui-blame.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui-blame.c b/ui-blame.c index daa7e2b..6e23f0b 100644 --- a/ui-blame.c +++ b/ui-blame.c @@ -154,7 +154,7 @@ static void print_object(const struct object_id *oid, 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"); @@ -206,6 +206,7 @@ static void print_object(const struct object_id *oid, const char *path, } else { html_txt(buf); } + html(""); html("\n"); @@ -213,6 +214,9 @@ static void print_object(const struct object_id *oid, const char *path, html("\n
\n"); cgit_print_layout_end(); + +cleanup: + free(buf); } static int walk_tree(const struct object_id *oid, struct strbuf *base,