[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2] qcow2: free old snapshots array upon creation of
From: |
Uri Lublin |
Subject: |
[Qemu-devel] [PATCH v2] qcow2: free old snapshots array upon creation of a new one |
Date: |
Thu, 08 Jan 2009 20:09:12 +0200 |
User-agent: |
Thunderbird 2.0.0.18 (X11/20081119) |
From: Uri Lublin <address@hidden>
Don't leak memory
Rebased for qemu tree.
Signed-off-by: Uri Lublin <address@hidden>
---
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;
--
1.6.0.6
- [Qemu-devel] [PATCH v2] qcow2: free old snapshots array upon creation of a new one,
Uri Lublin <=