diff --git a/src/libcharon/plugins/tnc_imv/tnc_imv_recommendations.c b/src/libcharon/plugins/tnc_imv/tnc_imv_recommendations.c index fb76d0057..5e8eccfce 100644 --- a/src/libcharon/plugins/tnc_imv/tnc_imv_recommendations.c +++ b/src/libcharon/plugins/tnc_imv/tnc_imv_recommendations.c @@ -328,7 +328,7 @@ METHOD(recommendations_t, destroy, void, { recommendation_entry_t *entry; - while (this->recs->remove_last(this->recs, (void**)&entry)) + while (this->recs->remove_last(this->recs, (void**)&entry) == SUCCESS) { free(entry->reason.ptr); free(entry->reason_language.ptr);