virsh-domain: Fix return of virshGetDBusDisplay() in one error path

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>
This commit is contained in:
Michal Privoznik 2024-02-07 13:28:31 +01:00
parent 27b8b035a6
commit ce41108ecc

View File

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