diff --git a/Platform/user/configm/config-server/agingtime_config/agingtime.c b/Platform/user/configm/config-server/agingtime_config/agingtime.c index 945b2445c..0e8a2feda 100644 --- a/Platform/user/configm/config-server/agingtime_config/agingtime.c +++ b/Platform/user/configm/config-server/agingtime_config/agingtime.c @@ -101,7 +101,6 @@ ret_code agingtime_config_chk(uint source, uint *config_type, char * ret_char = NULL; int * ret_int = NULL; - /*JSON字符串到JSON格式 */ cjson = cJSON_Parse(input); if(!cjson) @@ -128,23 +127,9 @@ ret_code agingtime_config_chk(uint source, uint *config_type, return ret; } - /*创建json对象 */ - res = cJSON_CreateObject(); - if(!res) - { - ret = RET_ERR; - ASSERT_RET(ret); - return ret; - } + cJSON_Delete(cjson); - cJSON_AddNumberToObject(res, "time", time->valueint); - - /*将json对象转换成json字符串 */ - ret_char = cJSON_PrintUnformatted(res); - ret_int = (int*)ret_char; - memcpy(output, ret_int, sizeof(ret_int)+1); - - cJSON_Delete(res); + ASSERT_RET(ret); return RET_OK; } @@ -228,7 +213,9 @@ ret_code agingtime_config_proc(uint source, uint config_type, ret_char = cJSON_PrintUnformatted(res); ret_int =(int*)ret_char; memcpy(output, ret_int, sizeof(ret_int)+1); - + + free(ret_char); + cJSON_Delete(cjson); cJSON_Delete(res); /*把免认证规则的配置信息存入全局变量 */