diff --git a/src/create_pcid.c b/src/create_pcid.c index c2c429b1d5b3acc488092e8291e9334a052a3e4b..d7000b8914c07ad0ab710841addc7654db633739 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 93d33448ecb382319c57cbddecd869a5e5d6f292..4ff330ad0b2160799bc13b8731d2d60cfdb4e8e4 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: