diff options
author | phk <phk@FreeBSD.org> | 2008-10-16 20:56:09 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2008-10-16 20:56:09 +0000 |
commit | 3c06fc1b163d867dbf870f99b31a4ebe6711182c (patch) | |
tree | 19d02660a045883babe658d37500c4ca58cd4b1b /usr.bin | |
parent | e0d6bb5c82080821b71a0be0384ee81829521e72 (diff) | |
download | FreeBSD-src-3c06fc1b163d867dbf870f99b31a4ebe6711182c.zip FreeBSD-src-3c06fc1b163d867dbf870f99b31a4ebe6711182c.tar.gz |
Free old arrays if we increase them.
Pointed out by: mlaier
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ministat/ministat.c | 1 |
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; |