From 32ce66f5eac3b499d4cf3b1a2176323c2f74f1f1 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 2 Jun 2011 15:45:31 -0600 Subject: [PATCH] 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. --- src/remote/remote_driver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 14c3d2414c..8335a1aed7 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -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; } }