aboutsummaryrefslogtreecommitdiff
path: root/tests/virtio-net-test.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2016-05-05 16:53:35 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2016-06-20 11:44:12 +0100
commitf1d3b99154138741161fc52f5a8c373bf71613c6 (patch)
tree9b8dc89292f0f64c6151601192a12c0805bc3047 /tests/virtio-net-test.c
parentc75f4c061bacad0c41708bf17d526fac72314ad0 (diff)
libqos: add qvirtqueue_cleanup()
qvirtqueue_setup() allocates the vring and virtqueue state. So far there has been no function to free it. Callers have been using guest_free() for the vring but forgot to free the QVirtQueue state. This patch solves the memory leak by introducing qvirtqueue_cleanup(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/virtio-net-test.c')
-rw-r--r--tests/virtio-net-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
index 17124509a3..0d2c63f8ab 100644
--- a/tests/virtio-net-test.c
+++ b/tests/virtio-net-test.c
@@ -229,7 +229,7 @@ static void pci_basic(gconstpointer data)
/* End test */
close(sv[0]);
- guest_free(alloc, tx->vq.desc);
+ qvirtqueue_cleanup(&qvirtio_pci, &tx->vq, alloc);
pc_alloc_uninit(alloc);
qvirtio_pci_device_disable(dev);
g_free(dev);