From: John Ferlan Date: Wed, 13 May 2015 10:50:48 +0000 (-0400) Subject: conf: Resolve Coverity FORWARD_NULL X-Git-Tag: v1.2.16-rc1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=264965d927bed3d31b55ad3dd50e9d583e701810;p=thirdparty%2Flibvirt.git conf: Resolve Coverity FORWARD_NULL Even though it's been pointed out they are false positives: http://www.redhat.com/archives/libvir-list/2015-May/msg00301.html and http://www.redhat.com/archives/libvir-list/2015-May/msg00302.html these still show up as Coverity issues. In order to silence Coverity add an 'sa_assert' prior to check failure. Signed-off-by: John Ferlan --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 631f9ebe03..d5207b1207 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -23274,6 +23274,7 @@ virDomainObjListCollect(virDomainObjListPtr domlist, struct virDomainListData data = { NULL, 0 }; virObjectLock(domlist); + sa_assert(domlist->objs); if (VIR_ALLOC_N(data.vms, virHashSize(domlist->objs)) < 0) { virObjectUnlock(domlist); return -1; @@ -23336,6 +23337,7 @@ virDomainObjListConvert(virDomainObjListPtr domlist, } virObjectUnlock(domlist); + sa_assert(*vms); virDomainObjListFilter(vms, nvms, conn, filter, flags); return 0;