aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net.c b/net.c
index 2686f78b88..bcc517633b 100644
--- a/net.c
+++ b/net.c
@@ -2803,8 +2803,13 @@ void net_client_uninit(NICInfo *nd)
{
nd->vlan->nb_guest_devs--;
nb_nics--;
- nd->used = 0;
- free((void *)nd->model);
+
+ qemu_free((void *)nd->model);
+ qemu_free((void *)nd->name);
+ qemu_free((void *)nd->devaddr);
+ qemu_free((void *)nd->id);
+
+ memset(nd, 0, sizeof(*nd));
}
static int net_host_check_device(const char *device)