check if optional terminate() function exists
authorAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 4 Nov 2010 22:59:31 +0000 (23:59 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 9 Nov 2010 19:43:50 +0000 (20:43 +0100)
src/libcharon/plugins/tnc_imc/tnc_imc_plugin.c
src/libcharon/plugins/tnc_imv/tnc_imv_plugin.c

index 1feedf9..21cca66 100644 (file)
@@ -25,7 +25,8 @@ METHOD(plugin_t, destroy, void,
 
        while (charon->imcs->remove_last(charon->imcs, (void**)&imc) == SUCCESS)
        {
-               if (imc->terminate(imc->get_id(imc)) != TNC_RESULT_SUCCESS)
+               if (imc->terminate &&
+                       imc->terminate(imc->get_id(imc)) != TNC_RESULT_SUCCESS)
                {
                        DBG1(DBG_TNC, "IMC '%s' not terminated successfully",
                                                   imc->get_name(imc));
index 34f5b76..99e4dce 100644 (file)
@@ -25,7 +25,8 @@ METHOD(plugin_t, destroy, void,
 
        while (charon->imvs->remove_last(charon->imvs, (void**)&imv) == SUCCESS)
        {
-               if (imv->terminate(imv->get_id(imv)) != TNC_RESULT_SUCCESS)
+               if (imv->terminate &&
+                       imv->terminate(imv->get_id(imv)) != TNC_RESULT_SUCCESS)
                {
                        DBG1(DBG_TNC, "IMV '%s' not terminated successfully",
                                                   imv->get_name(imv));