Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.zx2c4.com/cgit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2018-06-19 12:02:07 +0300
committerJohn Keeping <john@keeping.me.uk>2018-06-20 00:45:09 +0300
commitb759189574971eabf98aee73b4e4e4c604e21a94 (patch)
tree3564b0a33d7d7f5ac8f6ddee2f52ed53a5b1ce29
parent26610aff34b8dbbfa296bb7a9785c39831cfe7e3 (diff)
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>
-rw-r--r--ui-blame.c5
1 files changed, 4 insertions, 1 deletions
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("<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,