qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH 4/5] avoid dandling pointers


From: Frediano Ziglio
Subject: [Qemu-devel] [RFC PATCH 4/5] avoid dandling pointers
Date: Wed, 20 Jul 2011 09:57:03 +0200

Signed-off-by: Frediano Ziglio <address@hidden>
---
 block/qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/block/qcow.c b/block/qcow.c
index 8ccd7d7..007fb57 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -616,6 +616,7 @@ static int qcow_co_readv(BlockDriverState *bs, int64_t 
sector_num,
     if (acb.qiov->niov > 1) {
         qemu_iovec_from_buffer(acb.qiov, acb.orig_buf, acb.qiov->size);
         qemu_vfree(acb.orig_buf);
+        acb.orig_buf = NULL;
     }
 
     return ret;
@@ -700,6 +701,7 @@ static int qcow_co_writev(BlockDriverState *bs, int64_t 
sector_num,
 
     if (acb.qiov->niov > 1) {
         qemu_vfree(acb.orig_buf);
+        acb.orig_buf = NULL;
     }
 
     return ret;
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]