[PATCH 5/7] remoteDispatchDomainMigratePrepare: Don't pass uninitialized variable to VIR_FREE

Peter Krempa pkrempa at redhat.com
Thu Jun 11 09:43:37 UTC 2020


'uri_out' may be passed to VIR_FREE uninitialized if 'conn' is NULL.
Unfortunately the compiler isn't able to detect this problem when
VIR_FREE is implemented using g_clear_pointer. Initialize the variable.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/remote/remote_daemon_dispatch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
index 6f67d2fb30..69e9aa09b9 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -3030,7 +3030,7 @@ remoteDispatchDomainMigratePrepare(virNetServerPtr server G_GNUC_UNUSED,
     char *cookie = NULL;
     int cookielen = 0;
     char *uri_in;
-    char **uri_out;
+    char **uri_out = NULL;
     char *dname;
     int rv = -1;
     virConnectPtr conn = remoteGetHypervisorConn(client);
-- 
2.26.2




More information about the libvir-list mailing list