aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net.c')
-rw-r--r--net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net.c b/net.c
index 7a1b2dfa2b..ff6230c56c 100644
--- a/net.c
+++ b/net.c
@@ -1472,7 +1472,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;