diff --git a/services/timer/src/cjson_helper.cpp b/services/timer/src/cjson_helper.cpp index 75412594a99e0d3fa88395dec99503f58b901eb4..b33f045a769a2a3168692ac7a50cc91ec58e2f29 100644 --- a/services/timer/src/cjson_helper.cpp +++ b/services/timer/src/cjson_helper.cpp @@ -107,10 +107,12 @@ cJSON* CjsonHelper::QueryTable(std::string tableName, cJSON* db) cJSON* table = cJSON_GetObjectItem(db, tableName.c_str()); if (table == NULL) { TIME_HILOGE(TIME_MODULE_SERVICE, "%{public}s get fail!", tableName.c_str()); + cJSON_Delete(db); return data; } data = table; + cJSON_Delete(db); return data; }