neocgit

a more 'modern' version of cgit
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/neocgit

commit b759189574971eabf98aee73b4e4e4c604e21a94
parent 26610aff34b8dbbfa296bb7a9785c39831cfe7e3
Author: Andy Green <andy@warmcat.com>
Date:   Tue, 19 Jun 2018 17:02:07 +0800

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>

Diffstat:
Mui-blame.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ui-blame.c b/ui-blame.c @@ -154,7 +154,7 @@ static void print_object(const unsigned char *sha1, const char *path, 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 @@ static void print_object(const unsigned char *sha1, const char *path, html("</tr>\n</table>\n"); cgit_print_layout_end(); + +cleanup: + free(buf); } static int walk_tree(const unsigned char *sha1, struct strbuf *base,