summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorLibravatar Stefan Beller <stefanbeller@googlemail.com>2013-07-14 23:35:47 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-07-15 09:45:21 -0700
commit70a0cc9e5c62f7b8ce0acc693e10a9e080f187ef (patch)
treee6c6b10460565a844596189d8a83cace4c641d78 /builtin/commit.c
parentdaemon.c:handle: Remove unneeded check for null pointer. (diff)
downloadtgif-70a0cc9e5c62f7b8ce0acc693e10a9e080f187ef.tar.xz
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 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 = '@';