diff --git a/net.c b/net.c index 7a1b2dfa2bed8fd8eb6b9eebbc858c403e2b7476..ff6230c56c3c7d71e565c2c997ff8d37cc61abab 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;