bug-patch
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-patch] [PATCH] plug a leak in fetchname


From: Jim Meyering
Subject: [bug-patch] [PATCH] plug a leak in fetchname
Date: Tue, 24 May 2011 13:17:33 +0200

Also reported by coverity, this leak was not triggered by "make check":

>From 0e2f8b74f81893e3bee59c891b6ecdc2d2d4a00f Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 24 May 2011 13:16:27 +0200
Subject: [PATCH] plug a leak in fetchname

* src/util.c (fetchname): Don't leak "timestr" when returning early.
---
 src/util.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/util.c b/src/util.c
index 1016a8c..a846007 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1504,6 +1504,7 @@ fetchname (char const *at, int strip_leading, bool 
maybe_quoted, char **pname,
          if (! pstamp)
            {
              free (name);
+             free (timestr);
              return;
            }

--
1.7.5.2.585.gfbd48



reply via email to

[Prev in Thread] Current Thread [Next in Thread]