!486 释放部分变量内存

Merge pull request !486 from csliutt/master
This commit is contained in:
openharmony_ci
2024-08-16 01:08:25 +00:00
committed by Gitee
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: