svn commit: r183961 - head/usr.bin/ministat

Poul-Henning Kamp phk at FreeBSD.org
Thu Oct 16 20:56:11 UTC 2008


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;


More information about the svn-src-head mailing list