From 293aaaf8d64ecf54b3e6cfbaf570305f9735dc8b Mon Sep 17 00:00:00 2001 From: Caisking Date: Tue, 17 Mar 2026 15:36:55 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6=E4=BC=A0?= =?utf8?q?=E8=BE=93=E7=9A=84=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../services/ble_service/blemoder/bleInstruct.cpp | 5 +++-- .../ble_service/blemoder/bleinstruct_sample.cpp | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/code/sdk/zhihui/services/ble_service/blemoder/bleInstruct.cpp b/code/sdk/zhihui/services/ble_service/blemoder/bleInstruct.cpp index 4af3948cd..22d82adaf 100644 --- a/code/sdk/zhihui/services/ble_service/blemoder/bleInstruct.cpp +++ b/code/sdk/zhihui/services/ble_service/blemoder/bleInstruct.cpp @@ -893,9 +893,10 @@ char * tar_dir_to_json_buf_malloc_(char* file_name,uint32_t *file_size) char *json_format = cJSON_PrintUnformatted(itemJSON); - int pSize = cJSON_GetArraySize(dataJSON); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"文件数据:%s\r\n",json_format); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"文件数据:%s\r\n",json_format); + cJSON_Delete(itemJSON); cJSON_Delete(dataJSON); + cJSON_Delete(data_arryJSON); file_index++; return json_format; diff --git a/code/sdk/zhihui/services/ble_service/blemoder/bleinstruct_sample.cpp b/code/sdk/zhihui/services/ble_service/blemoder/bleinstruct_sample.cpp index 839fd53a2..3399cf26b 100644 --- a/code/sdk/zhihui/services/ble_service/blemoder/bleinstruct_sample.cpp +++ b/code/sdk/zhihui/services/ble_service/blemoder/bleinstruct_sample.cpp @@ -1891,9 +1891,10 @@ char * tar_dir_to_json_buf_malloc_(char* file_name,uint32_t *file_size) char *json_format = cJSON_PrintUnformatted(itemJSON); - int pSize = cJSON_GetArraySize(dataJSON); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"文件数据:%s\r\n",json_format); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"文件数据:%s\r\n",json_format); + cJSON_Delete(itemJSON); cJSON_Delete(dataJSON); + cJSON_Delete(data_arryJSON); file_index++; return json_format; @@ -3602,9 +3603,10 @@ char * tar_dir_to_json_buf_malloc_(char* file_name,uint32_t *file_size) char *json_format = cJSON_PrintUnformatted(itemJSON); - int pSize = cJSON_GetArraySize(dataJSON); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"文件数据:%s\r\n",json_format); + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"文件数据:%s\r\n",json_format); + cJSON_Delete(itemJSON); cJSON_Delete(dataJSON); + cJSON_Delete(data_arryJSON); file_index++; return json_format; @@ -3626,6 +3628,8 @@ char * tar_dir_to_json_buf_malloc_(char* file_name,uint32_t *file_size) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"opendir fail\r\n"); } + cJSON_Delete(dataJSON); + cJSON_Delete(data_arryJSON); return NULL; } -- 2.17.1