提交 32ce66f5 编写于 作者: E Eric Blake

build: silence coverity false positive

Coverity couldn't see that priv is NULL on failure.  But on failure,
we might as well guarantee that callers don't try to free uninitialized
memory.

* src/remote/remote_driver.c (remoteGenericOpen): Even on failure,
pass priv back to caller.
上级 89e651fa
......@@ -2545,10 +2545,8 @@ remoteGenericOpen(virConnectPtr conn, virConnectAuthPtr auth,
* use the UNIX transport. This handles Xen driver
* which doesn't have its own impl of the network APIs. */
struct private_data *priv;
int ret;
ret = remoteOpenSecondaryDriver(conn, auth, flags, &priv);
if (ret == VIR_DRV_OPEN_SUCCESS)
*genericPrivateData = priv;
int ret = remoteOpenSecondaryDriver(conn, auth, flags, &priv);
*genericPrivateData = priv;
return ret;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册