* [Qemu-devel] [6245] qcow2: free old snapshots array upon creation of a new one ( Uri Lublin)
@ 2009-01-08 19:32 Anthony Liguori
0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-01-08 19:32 UTC (permalink / raw)
To: qemu-devel
Revision: 6245
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6245
Author: aliguori
Date: 2009-01-08 19:32:20 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
qcow2: free old snapshots array upon creation of a new one (Uri Lublin)
Don't leak memory
Rebased for qemu tree.
Signed-off-by: Uri Lublin <uril@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/block-qcow2.c
Modified: trunk/block-qcow2.c
===================================================================
--- trunk/block-qcow2.c 2009-01-08 19:29:03 UTC (rev 6244)
+++ trunk/block-qcow2.c 2009-01-08 19:32:20 UTC (rev 6245)
@@ -2024,6 +2024,7 @@
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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-08 19:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-08 19:32 [Qemu-devel] [6245] qcow2: free old snapshots array upon creation of a new one ( Uri Lublin) Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).