From owner-svn-src-all@FreeBSD.ORG Thu Oct 16 20:56:11 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 649511065686; Thu, 16 Oct 2008 20:56:11 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 520498FC35; Thu, 16 Oct 2008 20:56:10 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9GKu9o2070369; Thu, 16 Oct 2008 20:56:09 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9GKu91q070368; Thu, 16 Oct 2008 20:56:09 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <200810162056.m9GKu91q070368@svn.freebsd.org> From: Poul-Henning Kamp Date: Thu, 16 Oct 2008 20:56:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r183961 - head/usr.bin/ministat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2008 20:56:11 -0000 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;