terminate imc/imv that couldn't be initialized properly
[strongswan.git] / src / libcharon / plugins / tnc_imv / tnc_imv_plugin.c
index 4dfe9ef..45cf95c 100644 (file)
@@ -130,6 +130,12 @@ static bool load_imvs(char *filename)
                }
                if (!charon->imvs->add(charon->imvs, imv))
                {
+                       if (imv->terminate &&
+                               imv->terminate(imv->get_id(imv)) != TNC_RESULT_SUCCESS)
+                       {
+                               DBG1(DBG_TNC, "IMV \"%s\" not terminated successfully",
+                                                          imv->get_name(imv));
+                       }
                        imv->destroy(imv);
                        return FALSE;
                }