Handle NULL return from os_zalloc() in sta_track_add()
This adds handling for a memory allocation failure in sta_track_add(). Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
This commit is contained in:
parent
fcd85d9a3f
commit
711e3cab07
1 changed files with 2 additions and 0 deletions
|
@ -632,6 +632,8 @@ void sta_track_add(struct hostapd_iface *iface, const u8 *addr)
|
|||
|
||||
/* Add a new entry */
|
||||
info = os_zalloc(sizeof(*info));
|
||||
if (info == NULL)
|
||||
return;
|
||||
os_memcpy(info->addr, addr, ETH_ALEN);
|
||||
os_get_reltime(&info->last_seen);
|
||||
|
||||
|
|
Loading…
Reference in a new issue