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:
Joel Cunningham 2016-09-02 15:38:47 -05:00 committed by Jouni Malinen
parent fcd85d9a3f
commit 711e3cab07

View file

@ -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);