Check dconnuri is not null or we will catch nullpointer later.
I hope this makes Coverity happy.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/libvirt-domain.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index f012f4b..380f374 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -4384,7 +4384,9 @@ virDomainMigrateToURI2(virDomainPtr domain,
if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
goto cleanup;
- if (!(flags & VIR_MIGRATE_PEER2PEER))
+ if (flags & VIR_MIGRATE_PEER2PEER)
+ virCheckNonNullArgGoto(dconnuri, cleanup);
+ else
dconnuri = NULL;
ret = virDomainMigrateUnmanaged(domain, NULL, flags,
@@ -4454,7 +4456,9 @@ virDomainMigrateToURI3(virDomainPtr domain,
if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
goto cleanup;
- if (!(flags & VIR_MIGRATE_PEER2PEER))
+ if (flags & VIR_MIGRATE_PEER2PEER)
+ virCheckNonNullArgGoto(dconnuri, cleanup);
+ else
dconnuri = NULL;
ret = virDomainMigrateUnmanagedParams(domain, dconnuri,
--
1.7.1