Message ID | 1575516542-54640-3-git-send-email-pannengyuan@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block/nbd: fix memory leak in nbd_open | expand |
diff --git a/block/nbd.c b/block/nbd.c index 8b4a65a..9062409 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -1891,6 +1891,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags, ret = nbd_client_connect(bs, errp); if (ret < 0) { + nbd_clear_bdrvstate(s); return ret; } /* successfully connected */