From 7708859c4dcebff1e43516c23a8bf80f88fcea35 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 13 Jun 2018 10:02:00 +0800 Subject: ui-tree: free read_sha1_file() buffer after use Free up the buffer allocated in read_sha1_file() Signed-off-by: Andy Green Signed-off-by: John Keeping --- ui-tree.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui-tree.c') diff --git a/ui-tree.c b/ui-tree.c index 67fd1bc..524de0f 100644 --- a/ui-tree.c +++ b/ui-tree.c @@ -127,6 +127,8 @@ static void print_object(const unsigned char *sha1, char *path, const char *base print_binary_buffer(buf, size); else print_text_buffer(basename, buf, size); + + free(buf); } struct single_tree_ctx { -- cgit v1.2.3-54-g00ecf