]> git.proxmox.com Git - qemu.git/commitdiff
net: Fix -net socket,listen (Jan Kiszka)
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Tue, 21 Apr 2009 19:56:11 +0000 (19:56 +0000)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 28 May 2009 07:02:04 +0000 (02:02 -0500)
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 <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Glauber Costa <glommer@redhat.com>
net.c

diff --git a/net.c b/net.c
index ae54421801e39186ae8bba1b86aeec02fd34b1ea..3938a029c5e9ac9a50163300fcca7b5a8ec3e897 100644 (file)
--- 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;