From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LL0cr-00018X-6h for qemu-devel@nongnu.org; Thu, 08 Jan 2009 14:33:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LL0cq-00016m-6p for qemu-devel@nongnu.org; Thu, 08 Jan 2009 14:33:04 -0500 Received: from [199.232.76.173] (port=39926 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL0cq-00016W-0Z for qemu-devel@nongnu.org; Thu, 08 Jan 2009 14:33:04 -0500 Received: from qw-out-1920.google.com ([74.125.92.149]:39754) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LL0cp-0005iI-Nk for qemu-devel@nongnu.org; Thu, 08 Jan 2009 14:33:03 -0500 Received: by qw-out-1920.google.com with SMTP id 5so4168653qwc.4 for ; Thu, 08 Jan 2009 11:33:02 -0800 (PST) Message-ID: <496654E7.8080808@codemonkey.ws> Date: Thu, 08 Jan 2009 13:32:55 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2] qcow2: free old snapshots array upon creation of a new one References: <49664148.9040405@redhat.com> In-Reply-To: <49664148.9040405@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Uri Lublin Uri Lublin wrote: > From: Uri Lublin > > Don't leak memory > > Rebased for qemu tree. > > Signed-off-by: Uri Lublin Applied. Well, sort of. It appears to be whitespace damaged and didn't apply. It was simple enough that I just made the change manually though. Regards, Anthony Liguori > --- > block-qcow2.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/block-qcow2.c b/block-qcow2.c > index 707109e..9aa7261 100644 > --- a/block-qcow2.c > +++ b/block-qcow2.c > @@ -2024,6 +2024,7 @@ static int qcow_snapshot_create(BlockDriverState > *bs, > if (!snapshots1) > goto fail; > memcpy(snapshots1, s->snapshots, s->nb_snapshots * > sizeof(QCowSnapshot)); > + qemu_free(s->snapshots); > s->snapshots = snapshots1; > s->snapshots[s->nb_snapshots++] = *sn; >