]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh-domain: Fix return of virshGetDBusDisplay() in one error path
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 7 Feb 2024 12:28:31 +0000 (13:28 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 7 Feb 2024 17:01:03 +0000 (18:01 +0100)
The virshGetDBusDisplay() function is declared to return a
pointer and yet, in one error path false is returned. Switch the
statement to return NULL, which is what other error paths use to
indicate an error.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tools/virsh-domain.c

index 58d5a4ab576abacf971466cd5d51007ccb146fa8..e69d14a6aaa0e1a5a2d6549bbcff469fa0c4c21d 100644 (file)
@@ -11908,7 +11908,7 @@ virshGetDBusDisplay(vshControl *ctl, xmlXPathContext *ctxt)
 
     addr = virXPathString(xpath, ctxt);
     if (!addr)
-        return false;
+        return NULL;
 
     if (STRPREFIX(addr, "unix:path=")) {
         return g_strdup_printf("dbus+unix://%s", addr + 10);