summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-09-13 19:59:19 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-09-13 19:59:19 +0000
commit05819105aecaf5d35b8dcae89a561bcf5563c2a3 (patch)
treec549200bdec1eeae6a49995356efd65da540c86f /usr.bin
parent17ce5824a8caf5e4b670c22521021ce974260421 (diff)
Plug mem leak. From Igor Zinovik; ok millert@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tail/read.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tail/read.c b/usr.bin/tail/read.c
index 29bbcc754fa..6e778ed339d 100644
--- a/usr.bin/tail/read.c
+++ b/usr.bin/tail/read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read.c,v 1.9 2006/03/24 17:10:02 kjell Exp $ */
+/* $OpenBSD: read.c,v 1.10 2007/09/13 19:59:18 otto Exp $ */
/* $NetBSD: read.c,v 1.4 1994/11/23 07:42:07 jtc Exp $ */
/*-
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: read.c,v 1.9 2006/03/24 17:10:02 kjell Exp $";
+static char rcsid[] = "$OpenBSD: read.c,v 1.10 2007/09/13 19:59:18 otto Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -91,6 +91,7 @@ bytes(FILE *fp, off_t off)
}
if (ferror(fp)) {
ierr();
+ free(sp);
return(1);
}
@@ -124,6 +125,8 @@ bytes(FILE *fp, off_t off)
if ((len = p - sp))
WR(sp, len);
}
+
+ free(sp);
return(0);
}