Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Oct 2008 20:56:09 +0000 (UTC)
From:      Poul-Henning Kamp <phk@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r183961 - head/usr.bin/ministat
Message-ID:  <200810162056.m9GKu91q070368@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: phk
Date: Thu Oct 16 20:56:09 2008
New Revision: 183961
URL: http://svn.freebsd.org/changeset/base/183961

Log:
  Free old arrays if we increase them.
  
  Pointed out by:	mlaier

Modified:
  head/usr.bin/ministat/ministat.c

Modified: head/usr.bin/ministat/ministat.c
==============================================================================
--- head/usr.bin/ministat/ministat.c	Thu Oct 16 20:39:02 2008	(r183960)
+++ head/usr.bin/ministat/ministat.c	Thu Oct 16 20:56:09 2008	(r183961)
@@ -160,6 +160,7 @@ AddPoint(struct dataset *ds, double a)
 		ds->lpoints *= 4;
 		ds->points = calloc(sizeof *ds->points, ds->lpoints);
 		memcpy(ds->points, dp, sizeof *dp * ds->n);
+		free(dp);
 	}
 	ds->points[ds->n++] = a;
 	ds->sy += a;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810162056.m9GKu91q070368>