xenapi: Resolve Coverity FORWARD_NULL

Since inception.  Coverity complains that the code checks "(record ==
NULL && !session->ok)", but doesn't check (record != NULL) before
dereferencing at "record->is_a_template"

(cherry picked from commit 500d77f1811c371598ab7a5fcc90bad45b52bafd)
This commit is contained in:
John Ferlan 2015-03-10 18:33:59 -04:00 committed by Cole Robinson
parent 193b057352
commit 2213707b6b

View File

@ -1646,9 +1646,11 @@ xenapiConnectNumOfDefinedDomains(virConnectPtr conn)
xen_vm_set_free(result);
return -1;
}
if (record->is_a_template == 0)
DomNum++;
xen_vm_record_free(record);
if (record) {
if (record->is_a_template == 0)
DomNum++;
xen_vm_record_free(record);
}
}
xen_vm_set_free(result);
return DomNum;