Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Beller <stefanbeller@googlemail.com>2013-07-15 01:35:47 +0400
committerJunio C Hamano <gitster@pobox.com>2013-07-15 20:45:21 +0400
commit70a0cc9e5c62f7b8ce0acc693e10a9e080f187ef (patch)
treee6c6b10460565a844596189d8a83cace4c641d78 /builtin
parent5d9cfa29d27156cc9a00c75eaa31b831107ed0b9 (diff)
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>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index d21d07a1a8..0575ad8ecd 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -526,7 +526,6 @@ static void determine_author_info(struct strbuf *author_ident)
(lb - strlen(" ") -
(a + strlen("\nauthor "))));
email = xmemdupz(lb + strlen("<"), rb - (lb + strlen("<")));
- date = xmemdupz(rb + strlen("> "), eol - (rb + strlen("> ")));
len = eol - (rb + strlen("> "));
date = xmalloc(len + 2);
*date = '@';