diff --git a/block/nbd.c b/block/nbd.c index 08ae47d83c..77b85ca471 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1889,6 +1889,8 @@ static int nbd_client_handshake(BlockDriverState *bs, Error **errp) nbd_yank, bs); object_unref(OBJECT(s->sioc)); s->sioc = NULL; + object_unref(OBJECT(s->ioc)); + s->ioc = NULL; return ret; }