[Bug] Using cJSON_free to free memory allocated by cJSON_Print

issueNo: https://gitee.com/openharmony/developtools_syscap_codec/issues/IAKW57

Signed-off-by: luming <luming29@huawei.com>
This commit is contained in:
luming
2024-08-19 11:42:40 +08:00
parent 670c5856f5
commit 2447b25c21
3 changed files with 7 additions and 5 deletions
+3 -1
View File
@@ -759,7 +759,9 @@ int32_t DecodeStringPCIDToJson(char *input, char *outDirPath)
ret = 0;
FAILED:
SafeFree(jsonBuffer);
if (jsonBuffer != NULL) {
cJSON_free(jsonBuffer)
}
SafeFree(priSyscapStr);
cJSON_Delete(sysCapObj);
cJSON_Delete(rootObj);