diff --git a/qemu-sockets.c b/qemu-sockets.c
index 23c3def..a191304 100644
--- a/qemu-sockets.c
+++ b/qemu-sockets.c
@@ -137,6 +137,9 @@ int inet_listen_opts(QemuOpts *opts, int port_offset)
     pstrcpy(port, sizeof(port), qemu_opt_get(opts, "port"));
     addr = qemu_opt_get(opts, "host");
 
+    if (!addr)
+	    return -1;
+
     to = qemu_opt_get_number(opts, "to", 0);
     if (qemu_opt_get_bool(opts, "ipv4", 0))
         ai.ai_family = PF_INET;
