[Top][All Lists]
[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
- [Qemu-devel] [RFC PATCH 0/5] Coroutines cleanup, Frediano Ziglio, 2011/07/20
- [Qemu-devel] [RFC PATCH 1/5] allocate AIO on stack, Frediano Ziglio, 2011/07/20
- [Qemu-devel] [RFC PATCH 2/5] use more stack, Frediano Ziglio, 2011/07/20
- [Qemu-devel] [RFC PATCH 3/5] more stack work, Frediano Ziglio, 2011/07/20
- [Qemu-devel] [RFC PATCH 4/5] avoid dandling pointers,
Frediano Ziglio <=
- [Qemu-devel] [RFC PATCH 5/5] qemu_aio_get used to clear all allocated buffer, Frediano Ziglio, 2011/07/20
- Re: [Qemu-devel] [RFC PATCH 0/5] Coroutines cleanup, Kevin Wolf, 2011/07/20