Browse Source

[patch] git: cleanup in ls-tree.c

cleanup: this patch adds a free() to ls-tree.c.

(Technically it's not a memory leak yet because the buffer is allocated
once by the function and then the utility exits - but it's a tad cleaner
to not leave such assumptions in the code, so that if someone reuses the
function (or extends the utility to include a loop) the uncleanliness
doesnt develop into a real memory leak.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>

Forward-ported.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
maint
Ingo Molnar 20 years ago committed by Petr Baudis
parent
commit
c599caca3a
  1. 1
      ls-tree.c

1
ls-tree.c

@ -77,6 +77,7 @@ static int list(unsigned char *sha1) @@ -77,6 +77,7 @@ static int list(unsigned char *sha1)
if (!buffer)
die("unable to read sha1 file");
list_recursive(buffer, "tree", size, NULL);
free(buffer);
return 0;
}


Loading…
Cancel
Save