Skip to content

Commit

Permalink
builtin-rerere: fix a small leak
Browse files Browse the repository at this point in the history
The data read from MERGE_RR file is kept in path-list by hanging textual
40-byte conflict signature to path of the blob that contains the
conflict.  The signature is strdup'ed twice, and the second copy is given
to the path-list, leaking the first copy.

Signed-off-by: Junio C Hamano <junio@pobox.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
  • Loading branch information
Junio C Hamano authored and Junio C Hamano committed Jun 17, 2008
1 parent 61fb0b7 commit 1a8fb15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-rerere.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static void read_rr(struct path_list *rr)
; /* do nothing */
if (i == sizeof(buf))
die("filename too long");
path_list_insert(buf, rr)->util = xstrdup(name);
path_list_insert(buf, rr)->util = name;
}
fclose(in);
}
Expand Down

0 comments on commit 1a8fb15

Please sign in to comment.