From ea053add700d8abe203cd79a9ffb082aee4eabc0 Mon Sep 17 00:00:00 2001 From: aliguori Date: Tue, 21 Apr 2009 19:56:11 +0000 Subject: net: Fix -net socket,listen (Jan Kiszka) In case no symbolic name is provided when requesting VLAN connection via listening TCP socket ('-net socket,listen=...'), qemu crashes. This fixes the cause. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7196 c046a42c-6fe2-441c-8c8c-71466251a162 --- net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net.c b/net.c index 7a1b2df..ff6230c 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; -- cgit v1.1