Handle NULL return from os_zalloc() in sta_track_add()
authorJoel Cunningham <joel.cunningham@me.com>
Fri, 2 Sep 2016 20:38:47 +0000 (15:38 -0500)
committerJouni Malinen <j@w1.fi>
Tue, 6 Sep 2016 15:58:08 +0000 (18:58 +0300)
This adds handling for a memory allocation failure in sta_track_add().

Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
src/ap/beacon.c

index 202abe6..0a006f9 100644 (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);