From 44a96fe914064df20b016778add77f2667e65169 Mon Sep 17 00:00:00 2001 From: Nikolay Shirokovskiy Date: Fri, 2 Oct 2015 10:52:52 +0300 Subject: [PATCH] migration: check dconnuri in p2p mode Check dconnuri is not null or we will catch nullpointer later. I hope this makes Coverity happy. Signed-off-by: Nikolay Shirokovskiy --- src/libvirt-domain.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index fe89d8cd89..e6c8604e47 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -4398,7 +4398,9 @@ virDomainMigrateToURI2(virDomainPtr domain, if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0) goto error; - if (!(flags & VIR_MIGRATE_PEER2PEER)) + if (flags & VIR_MIGRATE_PEER2PEER) + virCheckNonNullArgGoto(dconnuri, error); + else dconnuri = NULL; if (virDomainMigrateUnmanaged(domain, NULL, flags, @@ -4470,7 +4472,9 @@ virDomainMigrateToURI3(virDomainPtr domain, if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0) goto error; - if (!(flags & VIR_MIGRATE_PEER2PEER)) + if (flags & VIR_MIGRATE_PEER2PEER) + virCheckNonNullArgGoto(dconnuri, error); + else dconnuri = NULL; if (virDomainMigrateUnmanagedParams(domain, dconnuri,