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 <stefanbeller@googlemail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller committed
Jul 14, 2013 at 23:35 UTC
70a0cc9e5c62f7b8ce0acc693e10a9e080f187ef
1 file changed
-1
builtin/commit.c
-1
@@ -526,7 +526,6 @@ static void determine_author_info(struct strbuf *author_ident)
526
(lb - strlen(" ") -
527
(a + strlen("\nauthor "))));
528
email = xmemdupz(lb + strlen("<"), rb - (lb + strlen("<")));
529
- date = xmemdupz(rb + strlen("> "), eol - (rb + strlen("> ")));
529
len = eol - (rb + strlen("> "));
530
date = xmalloc(len + 2);
531
*date = '@';