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>
master
Michael S. Tsirkin 2011-06-21 20:34:17 +03:00
parent 89b9ba661b
commit c1be973ae1
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}