From 155e090cf6ebedae24a7fca1d2b1b0fc2ccb45db Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Thu, 15 Aug 2024 19:24:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=87=8A=E6=94=BEconvertedBuffer=E5=8F=98?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- src/syscap_tool.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/syscap_tool.c b/src/syscap_tool.c index 93d3344..e5953d6 100644 --- a/src/syscap_tool.c +++ b/src/syscap_tool.c @@ -285,8 +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_Delete(convertedBuffer); goto FREE_RPCID_ROOT; } + cJSON_Delete(convertedBuffer); FREE_RPCID_ROOT: cJSON_Delete(rpcidRoot); -- Gitee From 77f7ed3ee0410b2d14cfc3a963bfe5fbbd576212 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Thu, 15 Aug 2024 19:25:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=94=A8cJSON=5FDelete=E6=9B=BF=E6=8D=A2fr?= =?UTF-8?q?ee=E9=87=8A=E6=94=BEfreePcidJsonInfo.strJson=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- src/create_pcid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/create_pcid.c b/src/create_pcid.c index 811081d..b80a1e3 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_Delete(freePcidJsonInfo.strJson); cJSON_Delete(freePcidJsonInfo.jsonRootObj); FreeContextBuffer(freePcidJsonInfo.contextBuffer); break; -- Gitee