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
|
* use the UNIX transport. This handles Xen driver
|
||||||
* which doesn't have its own impl of the network APIs. */
|
* which doesn't have its own impl of the network APIs. */
|
||||||
struct private_data *priv;
|
struct private_data *priv;
|
||||||
int ret;
|
int ret = remoteOpenSecondaryDriver(conn, auth, flags, &priv);
|
||||||
ret = remoteOpenSecondaryDriver(conn, auth, flags, &priv);
|
*genericPrivateData = priv;
|
||||||
if (ret == VIR_DRV_OPEN_SUCCESS)
|
|
||||||
*genericPrivateData = priv;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue