aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net.c b/net.c
index 90bd5a9047..8ddf872a6f 100644
--- a/net.c
+++ b/net.c
@@ -1208,6 +1208,10 @@ int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
}
res = net_client_init(mon, opts, 1);
+ if (res < 0) {
+ qemu_opts_del(opts);
+ }
+
return res;
}