nbd: fix resource leak

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
Gonglei 2015-02-27 15:50:11 +08:00 committed by Michael Tokarev
parent 3e4c67c9ce
commit 9d0b65e6e8
1 changed files with 1 additions and 0 deletions

View File

@ -274,6 +274,7 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags,
*/
sock = nbd_establish_connection(bs, errp);
if (sock < 0) {
g_free(export);
return sock;
}