On a Thursday in 2020, Peter Krempa wrote:
'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 <[email protected]>
---
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);

Same problem is present in:

    remoteDispatchDomainMigratePrepare2
    remoteDispatchDomainMigratePrepare3
    remoteDispatchDomainMigratePrepare3Params

Reviewed-by: Ján Tomko <[email protected]>

Jano

Attachment: signature.asc
Description: PGP signature

Reply via email to