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.)

        Ingo

Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>

--- ls-tree.c.orig
+++ ls-tree.c
@@ -33,6 +33,8 @@ static int list(unsigned char *sha1)
                type = S_ISDIR(mode) ? "tree" : "blob";
                printf("%03o\t%s\t%s\t%s\n", mode, type, sha1_to_hex(sha1), 
path);
        }
+       free(buffer);
+
        return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to