mirror of https://gitee.com/openkylin/libvirt.git
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.
This commit is contained in:
parent
89e651fa76
commit
32ce66f5ea
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue