qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a new one
@ 2009-01-05  0:52 Uri Lublin
  2009-01-07 16:54 ` Anthony Liguori
  0 siblings, 1 reply; 4+ messages in thread
From: Uri Lublin @ 2009-01-05  0:52 UTC (permalink / raw)
  To: qemu-devel

Don't leak memory

Signed-off-by: Uri Lublin <uril@redhat.com>
---
  qemu/block-qcow2.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/qemu/block-qcow2.c b/qemu/block-qcow2.c
index b3b5f8f..4a2d0a3 100644
--- a/qemu/block-qcow2.c
+++ b/qemu/block-qcow2.c
@@ -2021,6 +2021,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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-08 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-05  0:52 [Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a new one Uri Lublin
2009-01-07 16:54 ` Anthony Liguori
2009-01-07 17:27   ` Johannes Schindelin
2009-01-08 13:52     ` Avi Kivity

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).