the patch below fixes a third memory leak in update-cache.c. (the 
mmap-ed file needs to be unmapped too) Ontop of the previous 
update-cache.c patches.

        Ingo

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

--- update-cache.c.orig
+++ update-cache.c
@@ -32,6 +32,8 @@ static int index_fd(const char *path, in
        if (!out || (int)(long)in == -1) {
                free(out);
                free(metadata);
+               if ((int)(long)in != -1 && size)
+                       munmap(in, size);
                return -1;
        }
 
@@ -66,6 +68,8 @@ static int index_fd(const char *path, in
                
        free(out);
        free(metadata);
+       if (size)
+               munmap(in, size);
 
        return ret;
 }
-
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