summaryrefslogtreecommitdiffstats
path: root/usr.bin/ministat
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2008-10-16 20:56:09 +0000
committerphk <phk@FreeBSD.org>2008-10-16 20:56:09 +0000
commit3c06fc1b163d867dbf870f99b31a4ebe6711182c (patch)
tree19d02660a045883babe658d37500c4ca58cd4b1b /usr.bin/ministat
parente0d6bb5c82080821b71a0be0384ee81829521e72 (diff)
downloadFreeBSD-src-3c06fc1b163d867dbf870f99b31a4ebe6711182c.zip
FreeBSD-src-3c06fc1b163d867dbf870f99b31a4ebe6711182c.tar.gz
Free old arrays if we increase them.
Pointed out by: mlaier
Diffstat (limited to 'usr.bin/ministat')
-rw-r--r--usr.bin/ministat/ministat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c
index bab9a95..5873ca7 100644
--- a/usr.bin/ministat/ministat.c
+++ b/usr.bin/ministat/ministat.c
@@ -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;
OpenPOWER on IntegriCloud