Skip to content

Commit 1a8fb15

Browse files
Junio C Hamanogitster
authored andcommitted
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 <[email protected]> Acked-by: Johannes Schindelin <[email protected]>
1 parent 61fb0b7 commit 1a8fb15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-rerere.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static void read_rr(struct path_list *rr)
4343
; /* do nothing */
4444
if (i == sizeof(buf))
4545
die("filename too long");
46-
path_list_insert(buf, rr)->util = xstrdup(name);
46+
path_list_insert(buf, rr)->util = name;
4747
}
4848
fclose(in);
4949
}

0 commit comments

Comments
 (0)