this patch fixes a rare memory leak in rev-tree.c.

        Ingo

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

--- rev-tree.c.orig
+++ rev-tree.c
@@ -73,8 +73,11 @@ static int parse_commit(unsigned char *s
 
                rev->flags |= SEEN;
                buffer = bufptr = read_sha1_file(sha1, type, &size);
-               if (!buffer || strcmp(type, "commit"))
+               if (!buffer || strcmp(type, "commit")) {
+                       if (buffer)
+                               free(buffer);
                        return -1;
+               }
                bufptr += 46; /* "tree " + "hex sha1" + "\n" */
                while (!memcmp(bufptr, "parent ", 7) && !get_sha1_hex(bufptr+7, 
parent)) {
                        add_relationship(rev, parent);
-
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