imv-scanner: Only add a reason string if there is something to report

This commit is contained in:
Tobias Brunner 2013-04-25 12:43:23 +02:00
parent aa4ff3b211
commit 2c693364a8
1 changed files with 4 additions and 1 deletions

View File

@ -282,7 +282,10 @@ METHOD(imv_state_t, get_reason_string, bool,
/* Instantiate a TNC Reason String object */
DESTROY_IF(this->reason_string);
this->reason_string = imv_reason_string_create(*reason_language);
this->reason_string->add_reason(this->reason_string, reasons);
if (this->rec != TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION)
{
this->reason_string->add_reason(this->reason_string, reasons);
}
*reason_string = this->reason_string->get_encoding(this->reason_string);
return TRUE;