修改src/create_pcid.c文件,消除主干代码安全告警

506行freePcidJsonInfo异常后freePcidJsonInfo.sysCapObj 变量重新赋值为0,防止内存资源泄漏

Signed-off-by: tongkai0808fh <tongkai5@huawei.com>
This commit is contained in:
tongkai0808fh
2024-05-18 01:48:43 +00:00
committed by Gitee
parent 13bbb5d016
commit 4dfb32da6e
+1
View File
@@ -504,6 +504,7 @@ int32_t DecodePCID(char *inputFile, char *outDirPath)
freePcidJsonInfo.sysCapObj = cJSON_CreateObject();
ret = CheckSysCapObj(freePcidJsonInfo, pcidMain, contextBufLen, ret);
if (freePcidJsonInfo.flag == -1) {
freePcidJsonInfo.sysCapObj = NULL;
return FreeAfterDecodePCID(freePcidJsonInfo, FREE_DECODE_PCID_CONTEXT_OUT, ret);
}