double free in builtin-update-index.c
authorPierre Habouzit <madcoder@debian.org>
Thu, 27 Sep 2007 10:51:18 +0000 (12:51 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 29 Sep 2007 08:40:19 +0000 (01:40 -0700)
path_name is either ptr that should not be freed, or a pointer to a strbuf
buffer that is deallocated when exiting the loop. Don't do that !

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-update-index.c

index c76879ed7f8fb4fc46bd4193746e6bbfa50fa01a..e1a938d8971f11e1a1e963913ab23ff6acc0cea9 100644 (file)
@@ -377,8 +377,6 @@ static void read_index_info(int line_termination)
                                die("git-update-index: unable to update %s",
                                    path_name);
                }
-               if (path_name != ptr)
-                       free(path_name);
                continue;
 
        bad_line: