diff options
| author | Jian Wang | 2018-12-22 11:27:28 +0100 |
|---|---|---|
| committer | Michael S. Tsirkin | 2019-01-15 01:31:04 +0100 |
| commit | a5390d936714482ac5996e1635a6ffd9c3c133df (patch) | |
| tree | 7787614c302406064a9c79e20095bdaaf51e1ff3 /scripts/update-linux-headers.sh | |
| parent | hw/misc/ivshmem: Remove deprecated "ivshmem" legacy device (diff) | |
| download | qemu-a5390d936714482ac5996e1635a6ffd9c3c133df.tar.gz qemu-a5390d936714482ac5996e1635a6ffd9c3c133df.tar.xz qemu-a5390d936714482ac5996e1635a6ffd9c3c133df.zip | |
qemu: avoid memory leak while remove disk
Memset vhost_dev to zero in the vhost_dev_cleanup function.
This causes dev.vqs to be NULL, so that
vqs does not free up space when calling the g_free function.
This will result in a memory leak. But you can't release vqs
directly in the vhost_dev_cleanup function, because vhost_net
will also call this function, and vhost_net's vqs is assigned by array.
In order to solve this problem, we first save the pointer of vqs,
and release the space of vqs after vhost_dev_cleanup is called.
Signed-off-by: Jian Wang <wangjian161@huawei.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'scripts/update-linux-headers.sh')
0 files changed, 0 insertions, 0 deletions
