From 711e3cab0756623335af83599253971c468f0545 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Fri, 2 Sep 2016 15:38:47 -0500 Subject: [PATCH] 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 --- src/ap/beacon.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 202abe6..0a006f9 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -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); -- 2.1.4