Patchwork [24/30] qcow2: remove memory leak

login
register
mail settings
Submitter Kevin Wolf
Date Aug. 29, 2011, 2:53 p.m.
Message ID <1314629618-8308-25-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/112113/
State New
Headers show

Comments

Kevin Wolf - Aug. 29, 2011, 2:53 p.m.
From: Frediano Ziglio <freddy77@gmail.com>

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/block/qcow2.c b/block/qcow2.c
index 37dab65..b725d68 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -496,6 +496,7 @@  fail:
     qemu_co_mutex_unlock(&s->lock);
 
     qemu_iovec_destroy(&hd_qiov);
+    g_free(cluster_data);
 
     return ret;
 }
@@ -608,6 +609,7 @@  fail:
     qemu_co_mutex_unlock(&s->lock);
 
     qemu_iovec_destroy(&hd_qiov);
+    g_free(cluster_data);
 
     return ret;
 }