[v3,13/15] qcow2: remove memory leak

Submitted by Frediano Ziglio on Aug. 23, 2011, 1:21 p.m.

Details

Message ID 1314105682-28396-14-git-send-email-freddy77@gmail.com
State New
Headers show

Commit Message

Frediano Ziglio Aug. 23, 2011, 1:21 p.m.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
---
 block/qcow2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/block/qcow2.c b/block/qcow2.c
index d34bd72..07529b1 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -492,6 +492,7 @@  fail:
     qemu_co_mutex_unlock(&s->lock);
 
     qemu_iovec_destroy(&hd_qiov);
+    g_free(cluster_data);
 
     return ret;
 }
@@ -604,6 +605,7 @@  fail:
     qemu_co_mutex_unlock(&s->lock);
 
     qemu_iovec_destroy(&hd_qiov);
+    g_free(cluster_data);
 
     return ret;
 }