aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net.c b/net.c
index ae54421801..3938a029c5 100644
--- a/net.c
+++ b/net.c
@@ -1468,7 +1468,7 @@ static int net_socket_listen_init(VLANState *vlan,
}
s->vlan = vlan;
s->model = strdup(model);
- s->name = strdup(name);
+ s->name = name ? strdup(name) : NULL;
s->fd = fd;
qemu_set_fd_handler(fd, net_socket_accept, NULL, s);
return 0;