释放部分变量内存

Signed-off-by: liutuantuan <liutuantuan1@huawei.com>
This commit is contained in:
liutuantuan
2024-08-15 20:36:23 +08:00
parent 65c5e3b33d
commit b8fc8addff
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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;
+2 -1
View File
@@ -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: