From: Ján Tomko Date: Thu, 8 Mar 2018 16:34:56 +0000 (+0100) Subject: remote: simplify condition X-Git-Tag: v4.2.0-rc1~229 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90d7262552e8de3b067239b215903144a285723d;p=thirdparty%2Flibvirt.git remote: simplify condition In remoteConnectOpen, conn->uri cannot be NULL in the second part of the OR expression due to short-circuit evaluation. Signed-off-by: Ján Tomko --- diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 9ea726dc45..93cba5daa3 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -1310,7 +1310,7 @@ remoteConnectOpen(virConnectPtr conn, int ret, rflags = 0; const char *autostart = virGetEnvBlockSUID("LIBVIRT_AUTOSTART"); - if (inside_daemon && (!conn->uri || (conn->uri && !conn->uri->server))) + if (inside_daemon && (!conn->uri || !conn->uri->server)) return VIR_DRV_OPEN_DECLINED; if (!(priv = remoteAllocPrivateData()))