summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorStefan Beller <stefanbeller@googlemail.com>2013-07-14 21:35:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-07-15 16:45:21 (GMT)
commit70a0cc9e5c62f7b8ce0acc693e10a9e080f187ef (patch)
treee6c6b10460565a844596189d8a83cace4c641d78 /builtin/commit.c
parent5d9cfa29d27156cc9a00c75eaa31b831107ed0b9 (diff)
downloadgit-70a0cc9e5c62f7b8ce0acc693e10a9e080f187ef.zip
git-70a0cc9e5c62f7b8ce0acc693e10a9e080f187ef.tar.gz
git-70a0cc9e5c62f7b8ce0acc693e10a9e080f187ef.tar.bz2
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/commit.c')
-rw-r--r--builtin/commit.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index d21d07a..0575ad8 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 = '@';