mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-03 21:14:40 +08:00
Added some ASSERTs and NULL-pointer checks to sys_timeout/sys_untimeout
This commit is contained in:
parent
d4834803ae
commit
6a2e323792
@ -195,6 +195,7 @@ sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg)
|
|||||||
|
|
||||||
timeout = memp_malloc(MEMP_SYS_TIMEOUT);
|
timeout = memp_malloc(MEMP_SYS_TIMEOUT);
|
||||||
if (timeout == NULL) {
|
if (timeout == NULL) {
|
||||||
|
LWIP_ASSERT("sys_timeout: timeout != NULL", timeout != NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
timeout->next = NULL;
|
timeout->next = NULL;
|
||||||
@ -208,6 +209,8 @@ sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg)
|
|||||||
(void *)timeout, msecs, (void *)h, (void *)arg));
|
(void *)timeout, msecs, (void *)h, (void *)arg));
|
||||||
|
|
||||||
LWIP_ASSERT("sys_timeout: timeouts != NULL", timeouts != NULL);
|
LWIP_ASSERT("sys_timeout: timeouts != NULL", timeouts != NULL);
|
||||||
|
if (timeouts == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (timeouts->next == NULL) {
|
if (timeouts->next == NULL) {
|
||||||
timeouts->next = timeout;
|
timeouts->next = timeout;
|
||||||
@ -246,6 +249,9 @@ sys_untimeout(sys_timeout_handler h, void *arg)
|
|||||||
|
|
||||||
timeouts = sys_arch_timeouts();
|
timeouts = sys_arch_timeouts();
|
||||||
|
|
||||||
|
LWIP_ASSERT("sys_untimeout: timeouts != NULL", timeouts != NULL);
|
||||||
|
if (timeouts == NULL)
|
||||||
|
return;
|
||||||
if (timeouts->next == NULL)
|
if (timeouts->next == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user