Skip to content

Commit

Permalink
net: eepro100: fix memory leak in device uninit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Qiang authored and jasowang committed Oct 26, 2016
1 parent 9463c07 commit 2634ab7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/net/eepro100.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 2634ab7

Please sign in to comment.