From ce41108eccd7688dd19cd4c2ba7fc2aa0080b2ad Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 7 Feb 2024 13:28:31 +0100 Subject: [PATCH] virsh-domain: Fix return of virshGetDBusDisplay() in one error path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- tools/virsh-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 58d5a4ab57..e69d14a6aa 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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);