From 1f1c09d30d08afed0b1e8781abb019357e47abf6 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 28 Jun 1999 22:19:12 +0000 Subject: Patch from NetBSD-current: Avoid duplicate free() while reading system information. --- sysutils/top/patches/patch-ab | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'sysutils/top') diff --git a/sysutils/top/patches/patch-ab b/sysutils/top/patches/patch-ab index 3a2f1f26e40..cc5749e2201 100644 --- a/sysutils/top/patches/patch-ab +++ b/sysutils/top/patches/patch-ab @@ -1,8 +1,8 @@ -$NetBSD: patch-ab,v 1.7 1999/02/06 21:41:25 hubertf Exp $ +$NetBSD: patch-ab,v 1.8 1999/06/28 22:19:12 tron Exp $ ---- machine/m_netbsd13.c.orig Sat Feb 6 22:37:29 1999 -+++ machine/m_netbsd13.c Sat Feb 6 22:38:29 1999 -@@ -0,0 +1,882 @@ +--- machine/m_netbsd13.c.orig Tue Jun 29 00:14:19 1999 ++++ machine/m_netbsd13.c Tue Jun 29 00:16:18 1999 +@@ -0,0 +1,884 @@ +/* + * top - a top users display for Unix + * @@ -31,7 +31,7 @@ $NetBSD: patch-ab,v 1.7 1999/02/06 21:41:25 hubertf Exp $ + * matthew green + * + * -+ * $Id: patch-ab,v 1.7 1999/02/06 21:41:25 hubertf Exp $ ++ * $Id: patch-ab,v 1.8 1999/06/28 22:19:12 tron Exp $ + */ + +#include @@ -410,8 +410,10 @@ $NetBSD: patch-ab,v 1.7 1999/02/06 21:41:25 hubertf Exp $ + memory_stats[5] = dbtob(totalsize) / 1024 - memory_stats[4]; + /* Free here, before we malloc again in the next + * iteration of this loop. */ -+ if (seporig) ++ if (seporig) { + free(seporig); ++ seporig = NULL; ++ } + } while (0); + /* Catch the case where we malloc'd, but then exited the + * loop due to nswap != rnswap. */ -- cgit v1.2.3