mirror of
https://github.com/espressif/esp-idf.git
synced 2026-07-17 16:33:02 +03:00
fix(lwip): Adds nullchecks after DHCP server alloc'd pools
This commit is contained in:
@@ -1239,11 +1239,19 @@ static s16_t parse_msg(dhcps_t *dhcps, struct dhcps_msg *m, u16_t len)
|
||||
pnode = NULL;
|
||||
} else {
|
||||
pdhcps_pool = (struct dhcps_pool *)mem_calloc(1, sizeof(struct dhcps_pool));
|
||||
if (pdhcps_pool == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pdhcps_pool->ip.addr = dhcps->client_address.addr;
|
||||
memcpy(pdhcps_pool->mac, m->chaddr, sizeof(pdhcps_pool->mac));
|
||||
pdhcps_pool->lease_timer = lease_timer;
|
||||
pnode = (list_node *)mem_calloc(1, sizeof(list_node));
|
||||
if (pnode == NULL) {
|
||||
mem_free(pdhcps_pool);
|
||||
pdhcps_pool = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pnode->pnode = pdhcps_pool;
|
||||
pnode->pnext = NULL;
|
||||
|
||||
Reference in New Issue
Block a user