all repos — cgit @ b759189574971eabf98aee73b4e4e4c604e21a94

a hyperfast web frontend for git written in c

ui-blame: free read_sha1_file() buffer after use

Signed-off-by: Andy Green <andy@warmcat.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
Andy Green andy@warmcat.com
Tue, 19 Jun 2018 17:02:07 +0800
commit

b759189574971eabf98aee73b4e4e4c604e21a94

parent

26610aff34b8dbbfa296bb7a9785c39831cfe7e3

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M ui-blame.cui-blame.c

@@ -154,7 +154,7 @@ if (ctx.cfg.max_blob_size && size / 1024 > ctx.cfg.max_blob_size) {

htmlf("<div class='error'>blob size (%ldKB)" " exceeds display size limit (%dKB).</div>", size / 1024, ctx.cfg.max_blob_size); - return; + goto cleanup; } html("<table class='blame blob'>\n<tr>\n");

@@ -213,6 +213,9 @@

html("</tr>\n</table>\n"); cgit_print_layout_end(); + +cleanup: + free(buf); } static int walk_tree(const unsigned char *sha1, struct strbuf *base,