summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--block/nbd.c2
1 files changed, 2 insertions, 0 deletions
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;
     }