diff --git a/test/glimpse_detector/gtest_glimpse_detector_plugin.cpp b/test/glimpse_detector/gtest_glimpse_detector_plugin.cpp index 9e6db05..e28c14e 100644 --- a/test/glimpse_detector/gtest_glimpse_detector_plugin.cpp +++ b/test/glimpse_detector/gtest_glimpse_detector_plugin.cpp @@ -104,6 +104,7 @@ static void publish_session_test_result(struct glimpse_detector_test_plugin_env assert(0); } session_mq_publish_message(sess, env->expect_json_topic_id, cJSON_Print(ctx)); + cJSON_Delete(ctx); return; } @@ -185,6 +186,10 @@ extern "C" void *GLIMPSE_DETECTOR_TEST_PLUG_LOAD(struct stellar *st) extern "C" void GLIMPSE_DETECTOR_TEST_PLUG_UNLOAD(void *plugin_env) { struct glimpse_detector_test_plugin_env *env = (struct glimpse_detector_test_plugin_env *)plugin_env; + for(int i = 0; i < MAX_APP_ID_VALUE; i++) + { + if(env->g_proto_id2name[i])free(env->g_proto_id2name[i]); + } free(env); printf("GLIMPSE_DETECTOR_TEST_PLUG_UNLOAD OK!\n"); return ;