summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2008-08-26 20:26:25 +0000
committerjoerg <joerg@pkgsrc.org>2008-08-26 20:26:25 +0000
commit6d13d1e1b0620d5ad170a61c3ca65f2aafe3a823 (patch)
tree382df091337c9621c62c96f30c1c0aa06c2f641a /lang
parentcc9b0a06704d22a4242a8041f207e7a771021a15 (diff)
downloadpkgsrc-6d13d1e1b0620d5ad170a61c3ca65f2aafe3a823.tar.gz
As dholland pointed out, don't leak memory when FS needs resizing more
than once. Bump revision again.
Diffstat (limited to 'lang')
-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);