aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2011-06-21 20:34:17 +0300
committerMichael S. Tsirkin <mst@redhat.com>2011-07-17 18:47:33 +0300
commitc1be973ae1135588ed77b365bfd3bf063bac78ae (patch)
treec4d1a6164f95087c91962c7b691c6451af6a20a6 /hw
parent89b9ba661bd2d6155308f895ec075d813f0e129b (diff)
downloadqemu-c1be973ae1135588ed77b365bfd3bf063bac78ae.zip
qemu-c1be973ae1135588ed77b365bfd3bf063bac78ae.tar.gz
qemu-c1be973ae1135588ed77b365bfd3bf063bac78ae.tar.bz2
vhost: fix double free on device stop
vhost dev stop failed to clear the log field. Typically not an issue as dev start overwrites this field, but if logging gets disabled before the following start, it doesn't so this causes a double free. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/vhost.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/vhost.c b/hw/vhost.c
index 80f771e..c3d8821 100644
--- a/hw/vhost.c
+++ b/hw/vhost.c
@@ -784,5 +784,6 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)
hdev->started = false;
qemu_free(hdev->log);
+ hdev->log = NULL;
hdev->log_size = 0;
}