]> xenbits.xensource.com Git - libvirt.git/commitdiff
remoteOpenConn: Pass correct variable to virConnectSetIdentity()
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 19 May 2022 07:54:16 +0000 (09:54 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 19 May 2022 08:15:48 +0000 (10:15 +0200)
The remoteOpenConn() function was refactored recently. As a part
of that new variable @newconn was introduced which holds
virConnect object as it's being gradually constructed throughout
the function. At the very end, when everything succeeded the
variable is stolen into passed @conn. However, there was one
line missed in the refactor which still access the @conn instead
of @newconn leading to a NULL dereference.

Fixes: f7c422993e4c7ca3e58b1d0d69f4772851af399f
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/remote/remote_daemon_dispatch.c

index c1f85925a38e429f3ccfe185d4c6c63d07c6a63b..0fde4233a5f1478e2bf9f4fdc47c4f3974c64187 100644 (file)
@@ -1829,7 +1829,7 @@ remoteOpenConn(const char *uri,
     VIR_DEBUG("Opened driver %p", newconn);
 
     if (preserveIdentity) {
-        if (virConnectSetIdentity(*conn, identparams->par, identparams->npar, 0) < 0)
+        if (virConnectSetIdentity(newconn, identparams->par, identparams->npar, 0) < 0)
             return -1;
 
         VIR_DEBUG("Forwarded current identity to secondary driver");