pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/nbpatch nbpatch-20100124: Fix a memory leak.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7c26a720ac99
branches:  trunk
changeset: 570040:7c26a720ac99
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sat Jan 23 23:08:03 2010 +0000

description:
nbpatch-20100124: Fix a memory leak.

diffstat:

 devel/nbpatch/Makefile     |  4 ++--
 devel/nbpatch/files/util.c |  6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 77d88a5398a6 -r 7c26a720ac99 devel/nbpatch/Makefile
--- a/devel/nbpatch/Makefile    Sat Jan 23 23:05:14 2010 +0000
+++ b/devel/nbpatch/Makefile    Sat Jan 23 23:08:03 2010 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.4 2009/10/21 17:17:04 joerg Exp $
+# $NetBSD: Makefile,v 1.5 2010/01/23 23:08:03 joerg Exp $
 #
 
-DISTNAME=      nbpatch-20091021
+DISTNAME=      nbpatch-20100124
 CATEGORIES=    devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 77d88a5398a6 -r 7c26a720ac99 devel/nbpatch/files/util.c
--- a/devel/nbpatch/files/util.c        Sat Jan 23 23:05:14 2010 +0000
+++ b/devel/nbpatch/files/util.c        Sat Jan 23 23:08:03 2010 +0000
@@ -1,7 +1,7 @@
 /*
  * $OpenBSD: util.c,v 1.32 2006/03/11 19:41:30 otto Exp $
  * $DragonFly: src/usr.bin/patch/util.c,v 1.9 2007/09/29 23:11:10 swildner Exp $
- * $NetBSD: util.c,v 1.3 2009/05/09 20:09:33 joerg Exp $
+ * $NetBSD: util.c,v 1.4 2010/01/23 23:08:03 joerg Exp $
  */
 
 /*
@@ -327,8 +327,10 @@
 
        if (striplast) {
                char    *s = strrchr(tmpbuf, '/');
-               if (s == NULL)
+               if (s == NULL) {
+                       free(tmpbuf);
                        return; /* nothing to be done */
+               }
                *s = '\0';
        }
        if (mkpath(tmpbuf) != 0)



Home | Main Index | Thread Index | Old Index