summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorLi Qiang2016-10-08 14:07:25 +0200
committerJason Wang2016-10-26 03:57:59 +0200
commit2634ab7fe29b3f75d0865b719caf8f310d634aae (patch)
tree7e56272f33676c1880ee4be66e0d0ca84b4442a4 /hw
parenttap-bsd: OpenBSD uses tap(4) now (diff)
downloadqemu-2634ab7fe29b3f75d0865b719caf8f310d634aae.tar.gz
qemu-2634ab7fe29b3f75d0865b719caf8f310d634aae.tar.xz
qemu-2634ab7fe29b3f75d0865b719caf8f310d634aae.zip
net: eepro100: fix memory leak in device uninit
The exit dispatch of eepro100 network card device doesn't free the 's->vmstate' field which was allocated in device realize thus leading a host memory leak. This patch avoid this. Signed-off-by: Li Qiang <liqiang6-s@360.cn> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/net/eepro100.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index bab4dbfc98..4bf71f2d85 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -1843,6 +1843,7 @@ static void pci_nic_uninit(PCIDevice *pci_dev)
EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, pci_dev);
vmstate_unregister(&pci_dev->qdev, s->vmstate, s);
+ g_free(s->vmstate);
eeprom93xx_free(&pci_dev->qdev, s->eeprom);
qemu_del_nic(s->nic);
}