]> git.cameronkatri.com Git - cgit.git/commitdiff
ui-tree: free read_sha1_file() buffer after use
authorAndy Green <andy@warmcat.com>
Wed, 13 Jun 2018 02:02:00 +0000 (10:02 +0800)
committerJohn Keeping <john@keeping.me.uk>
Sat, 16 Jun 2018 14:20:11 +0000 (15:20 +0100)
Free up the buffer allocated in read_sha1_file()

Signed-off-by: Andy Green <andy@warmcat.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
ui-tree.c

index 67fd1bc51652b990be5e06be45d05821c7f67a02..524de0fc30d91caa8305cfd4ba40e74110b6a5f2 100644 (file)
--- 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 {