@matheusbsbs / matheus-bagliano / commits / 1a8fb155cf
Fork 0

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 <junio@pobox.com> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

Junio C Hamano committed Jun 17, 2008 at 00:23 UTC 1a8fb155cff5b19bc41ee3ac96e34f0f2ad95763
1 file changed +1 -1
builtin-rerere.c
+1 -1
@@ -43,7 +43,7 @@ static void read_rr(struct path_list *rr)
43 ; /* do nothing */
44 if (i == sizeof(buf))
45 die("filename too long");
46 - path_list_insert(buf, rr)->util = xstrdup(name);
46 + path_list_insert(buf, rr)->util = name;
47 }
48 fclose(in);
49 }