From b98daccedbdd64bf82dd2d9deecc4a4046976b47 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Thu, 15 Aug 2024 20:36:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8A=E6=94=BE=E9=83=A8=E5=88=86=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=86=85=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- src/create_pcid.c | 2 +- src/syscap_tool.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index c2c429b..d7000b8 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -448,7 +448,7 @@ static int32_t FreeAfterDecodePCID(struct FreeDecodePcidJsonInfo freePcidJsonInf { switch (type) { case FREE_DECODE_PCID_CONVERT_OUT: - free(freePcidJsonInfo.strJson); + cJSON_free(freePcidJsonInfo.strJson); cJSON_Delete(freePcidJsonInfo.jsonRootObj); FreeContextBuffer(freePcidJsonInfo.contextBuffer); break; diff --git a/src/syscap_tool.c b/src/syscap_tool.c index 93d3344..4ff330a 100644 --- a/src/syscap_tool.c +++ b/src/syscap_tool.c @@ -285,9 +285,10 @@ int32_t RPCIDDecode(char *inputFile, char *outputPath) ret = ConvertedContextSaveAsFile(outputPath, "rpcid.json", convertedBuffer, strlen(convertedBuffer)); if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outputPath:%s, filename:rpcid.json\n", outputPath); + cJSON_free(convertedBuffer); goto FREE_RPCID_ROOT; } - + cJSON_free(convertedBuffer); FREE_RPCID_ROOT: cJSON_Delete(rpcidRoot); FREE_CONTEXT_OUT: -- Gitee