[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a
From: |
Uri Lublin |
Subject: |
[Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a new one |
Date: |
Mon, 05 Jan 2009 02:52:47 +0200 |
User-agent: |
Thunderbird 2.0.0.18 (X11/20081119) |
Don't leak memory
Signed-off-by: Uri Lublin <address@hidden>
---
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;
- [Qemu-devel] [PATCH] qcow2: free old snapshots array upon creation of a new one,
Uri Lublin <=