mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
Bug fix #20478: memp_malloc returns NULL+MEMP_SIZE rather than NULL on a failed allocation
This commit is contained in:
parent
116bcb9dfb
commit
eb998bda62
@ -278,6 +278,8 @@ memp_overflow_init(void)
|
||||
|
||||
/**
|
||||
* Initialize this module.
|
||||
*
|
||||
* Carves out memp_memory into linked lists for each pool-type.
|
||||
*/
|
||||
void
|
||||
memp_init(void)
|
||||
@ -359,7 +361,8 @@ memp_malloc(memp_t type)
|
||||
|
||||
SYS_ARCH_UNPROTECT(old_level);
|
||||
|
||||
return (void*)((u8_t*)memp + MEMP_SIZE);
|
||||
/* (bug fix #20478): dont return NULL+MEMP_SIZE! */
|
||||
return (memp ? (void*)((u8_t*)memp + MEMP_SIZE) : NULL );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user