修复报警信息,为以下修复点
1、修复空指针未判断
2、修复open后未及时close 导致内存泄露
3、修复strdup后未free
4、修复赋值后未使用等问题
5、修复编码中判断条件中无符号变量小于零的情况

Signed-off-by: xiacong <xiacong4@huawei.com>
Change-Id: I13d046141afeb8a116e6a04304a3793bf8e12bee
Signed-off-by: xiacong <xiacong4@huawei.com>
This commit is contained in:
xiacong
2022-09-24 15:54:18 +08:00
parent 044cf59583
commit 784429d0dc
16 changed files with 37 additions and 29 deletions

View File

@@ -978,21 +978,17 @@ osStatus_t osEventFlagsDelete(osEventFlagsId_t ef_id)
{
PEVENT_CB_S pstEventCB = (PEVENT_CB_S)ef_id;
UINT32 intSave;
osStatus_t ret;
osStatus_t ret = osOK;
if (OS_INT_ACTIVE) {
return osErrorISR;
}
intSave = LOS_IntLock();
if (LOS_EventDestroy(pstEventCB) == LOS_OK) {
ret = osOK;
} else {
if (LOS_EventDestroy(pstEventCB) != LOS_OK) {
ret = osErrorParameter;
}
LOS_IntRestore(intSave);
if (LOS_MemFree(m_aucSysMem0, (void *)pstEventCB) == LOS_OK) {
ret = osOK;
} else {
if (LOS_MemFree(m_aucSysMem0, (void *)pstEventCB) != LOS_OK) {
ret = osErrorParameter;
}

View File

@@ -501,7 +501,7 @@ time_t time(time_t *timer)
{
UINT64 usec = 0;
time_t sec;
INT32 rtcRet = 0;
INT32 rtcRet;
if (g_rtcTimeFunc.RtcGetTimeHook != NULL) {
rtcRet = g_rtcTimeFunc.RtcGetTimeHook(&usec);