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: