mirror of
https://github.com/openharmony/developtools_syscap_codec.git
synced 2026-08-27 02:11:19 -04:00
增加interfaces/inner_api/syscap_interface.c文件564行和614行,tempSyscap和temp变量使用后内存释放,消除安全告警
Signed-off-by: tongkai0808fh <tongkai5@huawei.com>
This commit is contained in:
@@ -561,6 +561,7 @@ static int32_t CheckPcidEachBit(struct PcidPriSyscapInfo *pcidPriSyscapInfo, Com
|
||||
if (ret != EOK) {
|
||||
PRINT_ERR("strcpy_s failed.\n");
|
||||
FreeCompareError(result);
|
||||
free(tempSyscap);
|
||||
return -1;
|
||||
}
|
||||
result->syscap[pcidPriSyscapInfo->ossyscapFlag++] = tempSyscap;
|
||||
@@ -610,6 +611,7 @@ static int32_t ComparePcidWithPriSyscap(struct PcidPriSyscapInfo pcidPriSyscapIn
|
||||
if (temp == NULL) {
|
||||
PRINT_ERR("malloc failed.\n");
|
||||
FreeCompareError(result);
|
||||
free(temp);
|
||||
return -1;
|
||||
}
|
||||
pcidPriSyscapInfo.ret = strcpy_s(temp, sizeof(char) * SINGLE_SYSCAP_LEN,
|
||||
|
||||
Reference in New Issue
Block a user