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"
This commit is contained in:
John Ferlan 2015-03-10 18:33:59 -04:00
parent d9beeb68e4
commit 500d77f181

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;