this->handshake_state = IMV_SCANNER_STATE_INIT;
- DESTROY_IF(&this->port_filter_attr->pa_tnc_attribute);
- this->port_filter_attr = NULL;
+ if (this->port_filter_attr)
+ {
+ this->port_filter_attr->pa_tnc_attribute.destroy(
+ &this->port_filter_attr->pa_tnc_attribute);
+ this->port_filter_attr = NULL;
+ }
this->violating_ports->destroy_function(this->violating_ports, free);
this->violating_ports = linked_list_create();
}
DESTROY_IF(this->session);
DESTROY_IF(this->reason_string);
DESTROY_IF(this->remediation_string);
- DESTROY_IF(&this->port_filter_attr->pa_tnc_attribute);
+ if (this->port_filter_attr)
+ {
+ this->port_filter_attr->pa_tnc_attribute.destroy(
+ &this->port_filter_attr->pa_tnc_attribute);
+ }
this->contracts->destroy(this->contracts);
this->violating_ports->destroy_function(this->violating_ports, free);
free(this);
METHOD(imv_scanner_state_t, set_port_filter_attr, void,
private_imv_scanner_state_t *this, ietf_attr_port_filter_t *attr)
{
- DESTROY_IF(&this->port_filter_attr->pa_tnc_attribute);
+ if (this->port_filter_attr)
+ {
+ this->port_filter_attr->pa_tnc_attribute.destroy(
+ &this->port_filter_attr->pa_tnc_attribute);
+ }
this->port_filter_attr = attr;
}