From: Junio C Hamano Date: Tue, 17 Jun 2008 07:23:31 +0000 (-0700) Subject: builtin-rerere: fix a small leak X-Git-Tag: v1.5.6~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1a8fb155cff5b19bc41ee3ac96e34f0f2ad95763;p=git.git builtin-rerere: fix a small leak 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 Acked-by: Johannes Schindelin --- diff --git a/builtin-rerere.c b/builtin-rerere.c index 5c811423c..85222d9bc 100644 --- a/builtin-rerere.c +++ b/builtin-rerere.c @@ -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); }