Skip to content

Commit

Permalink
double free in builtin-update-index.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pierre Habouzit authored and Junio C Hamano committed Sep 29, 2007
1 parent 6d69b6f commit 690b61f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions builtin-update-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 690b61f

Please sign in to comment.