diff options
-rw-r--r-- | hw/net/virtio-net.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 5150f29..1c5af08 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -862,6 +862,8 @@ static void failover_add_primary(VirtIONet *n, Error **errp) dev = qdev_device_add(opts, &err); if (err) { qemu_opts_del(opts); + } else { + object_unref(OBJECT(dev)); } } else { error_setg(errp, "Primary device not found"); |