提交 cc1e1391 编写于 作者: Y yaolujing 提交者: Paolo Bonzini

nbd: fix memory leak on socket_connect failed

When TCP connection fails between nbd server and client,
the local var, sioc, memory leak.

This patch fixes the memory leak.
Signed-off-by: Nyaolujing <yaolujing@huawei.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Message-Id: <1491005709-29989-1-git-send-email-yaolujing@huawei.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 cb9a05a4
......@@ -311,6 +311,7 @@ static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr,
saddr,
&local_err);
if (local_err) {
object_unref(OBJECT(sioc));
error_propagate(errp, local_err);
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册