summaryrefslogtreecommitdiff
path: root/usr.bin/patch/util.c
diff options
context:
space:
mode:
authorjoerg <joerg@NetBSD.org>2010-01-10 01:10:16 +0000
committerjoerg <joerg@NetBSD.org>2010-01-10 01:10:16 +0000
commit06c042e9bc9ce5079c2e90eff7e8b91a518edf10 (patch)
tree2a49a28cf54a475840cf34fedbe44f519766714d /usr.bin/patch/util.c
parent8ab319847f48bfbaad53d090705347a772b02103 (diff)
Plug a memory leak. From Igor Zinovik.
Diffstat (limited to 'usr.bin/patch/util.c')
-rw-r--r--usr.bin/patch/util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/patch/util.c b/usr.bin/patch/util.c
index bc5b2607a7a..0ae5a47dc17 100644
--- a/usr.bin/patch/util.c
+++ b/usr.bin/patch/util.c
@@ -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.24 2008/09/19 18:33:34 joerg Exp $
+ * $NetBSD: util.c,v 1.25 2010/01/10 01:10:16 joerg Exp $
*/
/*
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: util.c,v 1.24 2008/09/19 18:33:34 joerg Exp $");
+__RCSID("$NetBSD: util.c,v 1.25 2010/01/10 01:10:16 joerg Exp $");
#include <sys/param.h>
#include <sys/stat.h>
@@ -326,8 +326,10 @@ makedirs(const char *filename, bool striplast)
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)
s/dev/ic/adw.c?h=lockdoc-9.3-0.5&id=0884f20bf7a257624c0e215ca6cc1c6884e03352'>bzero -> memsetthorpej 2001-07-07bcopy -> memcpythorpej 2001-04-30remove some lint, including ansifying funcslukem 2001-04-25Pull up the thorpej_scsipi branch to main branch.bouyer 2001-03-07Add BUS_DMA_STREAMING to data transfer maps.thorpej 2001-02-11Fix for kern/12114 and kern/12158 Advansys DMA errors.hpeyerl 2000-11-14NBPG -> PAGE_SIZEthorpej 2000-06-28remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>mrg 2000-06-26remove redundant vm includes.mrg