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:
Eric Blake 2011-06-02 15:45:31 -06:00
parent 89e651fa76
commit 32ce66f5ea
1 changed files with 2 additions and 4 deletions

View File

@ -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;
} }
} }