Skip to content

Commit 70a0cc9

Browse files
stefanbellergitster
authored andcommitted
commit: Fix a memory leak in determine_author_info
The date variable is assigned new memory via xmemdupz and 2 lines later it is assigned new memory again via xmalloc, but the first assignment is never freed nor used. Signed-off-by: Stefan Beller <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5d9cfa2 commit 70a0cc9

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

builtin/commit.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ static void determine_author_info(struct strbuf *author_ident)
526526
(lb - strlen(" ") -
527527
(a + strlen("\nauthor "))));
528528
email = xmemdupz(lb + strlen("<"), rb - (lb + strlen("<")));
529-
date = xmemdupz(rb + strlen("> "), eol - (rb + strlen("> ")));
530529
len = eol - (rb + strlen("> "));
531530
date = xmalloc(len + 2);
532531
*date = '@';

0 commit comments

Comments
 (0)