[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 27/32] virtio-net: fix the memory leak in rxfilter_n
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 27/32] virtio-net: fix the memory leak in rxfilter_notify() |
Date: |
Wed, 4 Dec 2013 08:34:34 -0600 |
From: Amos Kong <address@hidden>
object_get_canonical_path() returns a gchar*, it should be freed by the
caller.
Signed-off-by: Amos Kong <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Vlad Yasevich <address@hidden>
Reviewed-by: Andreas Färber <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
(cherry picked from commit 96e35046e4a97df5b4e1e24e217eb1e1701c7c71)
Signed-off-by: Michael Roth <address@hidden>
---
hw/net/virtio-net.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index bb757b3..5320aab 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -200,16 +200,16 @@ static void rxfilter_notify(NetClientState *nc)
VirtIONet *n = qemu_get_nic_opaque(nc);
if (nc->rxfilter_notify_enabled) {
+ gchar *path = object_get_canonical_path(OBJECT(n->qdev));
if (n->netclient_name) {
event_data = qobject_from_jsonf("{ 'name': %s, 'path': %s }",
- n->netclient_name,
-
object_get_canonical_path(OBJECT(n->qdev)));
+ n->netclient_name, path);
} else {
- event_data = qobject_from_jsonf("{ 'path': %s }",
-
object_get_canonical_path(OBJECT(n->qdev)));
+ event_data = qobject_from_jsonf("{ 'path': %s }", path);
}
monitor_protocol_event(QEVENT_NIC_RX_FILTER_CHANGED, event_data);
qobject_decref(event_data);
+ g_free(path);
/* disable event notification to avoid events flooding */
nc->rxfilter_notify_enabled = 0;
--
1.7.9.5
- [Qemu-devel] [PATCH 10/32] xen_disk: mark ioreq as mapped before unmapping in error case, (continued)
- [Qemu-devel] [PATCH 10/32] xen_disk: mark ioreq as mapped before unmapping in error case, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 08/32] misc: Use new rotate functions, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 12/32] audio: honor QEMU_AUDIO_TIMER_PERIOD instead of waking up every *nano* second, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 30/32] qdev-monitor: Unref device when device_add fails, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 31/32] pci: unregister vmstate_pcibus on unplug, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 32/32] rng-egd: offset the point when repeatedly read from the buffer, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 29/32] qdev-monitor: Fix crash when device_add is called with abstract driver, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 26/32] vfio-pci: Fix multifunction=on, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 28/32] qom: Fix memory leak in object_property_set_link(), Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 13/32] monitor: eliminate monitor_event_state_lock, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 27/32] virtio-net: fix the memory leak in rxfilter_notify(),
Michael Roth <=
- [Qemu-devel] [PATCH 21/32] virtio-net: only delete bh that existed, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 24/32] qcow2: count_contiguous_clusters and compression, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 25/32] qcow2: fix possible corruption when reading multiple clusters, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 20/32] linux-user: Fix stat64 syscall for SPARC64, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 14/32] memory: fix 128 arithmetic in info mtree, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 19/32] configure: Explicitly set ARFLAGS so we can build with GNU Make 4.0, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 17/32] qapi: fix memleak by adding implict struct functions in dealloc visitor, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 11/32] vmdk: Fix vmdk_parse_extents, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 15/32] Adjust qapi-visit for python-2.4.3, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 18/32] tests: fix memleak in error path test for input visitor, Michael Roth, 2013/12/04