summaryrefslogtreecommitdiff
path: root/lang/nawk
diff options
context:
space:
mode:
authorjoerg <joerg>2008-08-26 20:26:25 +0000
committerjoerg <joerg>2008-08-26 20:26:25 +0000
commit47d2d264b9ea45a472b65d8ec108d32bb8bc2213 (patch)
tree382df091337c9621c62c96f30c1c0aa06c2f641a /lang/nawk
parent8485db0dbe6eeb1b3d5bc69b61fed751b0f7bd7e (diff)
downloadpkgsrc-47d2d264b9ea45a472b65d8ec108d32bb8bc2213.tar.gz
As dholland pointed out, don't leak memory when FS needs resizing more
than once. Bump revision again.
Diffstat (limited to 'lang/nawk')
-rw-r--r--lang/nawk/Makefile4
-rw-r--r--lang/nawk/files/lib.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/lang/nawk/Makefile b/lang/nawk/Makefile
index 611b509cc35..77f78a4c739 100644
--- a/lang/nawk/Makefile
+++ b/lang/nawk/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.33 2008/08/26 14:46:21 joerg Exp $
+# $NetBSD: Makefile,v 1.34 2008/08/26 20:26:25 joerg Exp $
DISTNAME= nawk-20050424
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= lang
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/lang/nawk/files/lib.c b/lang/nawk/files/lib.c
index 8fc16c2932d..ece88c1ac02 100644
--- a/lang/nawk/files/lib.c
+++ b/lang/nawk/files/lib.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.c,v 1.2 2008/08/26 14:46:21 joerg Exp $ */
+/* $NetBSD: lib.c,v 1.3 2008/08/26 20:26:25 joerg Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
@@ -193,6 +193,8 @@ int readrec(char **pbuf, int *pbufsize, FILE *inf) /* read one record into buf *
if ((len = strlen(*FS)) <= len_inputFS) {
strcpy(inputFS, *FS); /* for subsequent field splitting */
} else {
+ if (inputFS != static_inputFS)
+ free(inputFS);
inputFS = malloc(len + 1);
if (inputFS == NULL)
FATAL("field separator %.10s... is too long", *FS);