aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/net.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/net.c b/net/net.c
index efb9eaf779..2a3133990c 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1093,7 +1093,9 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
int ret = -1;
Visitor *v = opts_visitor_new(opts);
- if (is_netdev && is_help_option(qemu_opt_get(opts, "type"))) {
+ const char *type = qemu_opt_get(opts, "type");
+
+ if (is_netdev && type && is_help_option(type)) {
show_netdevs();
exit(0);
} else {