aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Eilam <guy@wizery.com>2011-04-15 15:13:04 (GMT)
committerJouni Malinen <j@w1.fi>2011-04-15 15:13:04 (GMT)
commit5b73735ba07d50583d41fa0f35a75e74ea53354d (patch)
tree30ee49af7de877219b4b7edf5103ea756ebf5602
parent849b5dc78b6eeb35d6544819efc4d8d1b31217fb (diff)
downloadhostap-5b73735ba07d50583d41fa0f35a75e74ea53354d.zip
hostap-5b73735ba07d50583d41fa0f35a75e74ea53354d.tar.gz
hostap-5b73735ba07d50583d41fa0f35a75e74ea53354d.tar.bz2
hostapd: Fix interfaces.iface initialization
Set all the interfaces.iface pointers to NULL after the allocation of that memory block for cases those pointers are accessed during each of the interfaces initialization process (hostapd_interface_init()). One example for such case is during WPS initialization when the code tries to fetch the uuid from each of the interfaces. Signed-off-by: Guy Eilam <guy@wizery.com>
-rw-r--r--hostapd/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hostapd/main.c b/hostapd/main.c
index c169375..7a4cfb0 100644
--- a/hostapd/main.c
+++ b/hostapd/main.c
@@ -557,10 +557,10 @@ int main(int argc, char *argv[])
wpa_debug_open_file(log_file);
interfaces.count = argc - optind;
- interfaces.iface = os_malloc(interfaces.count *
+ interfaces.iface = os_zalloc(interfaces.count *
sizeof(struct hostapd_iface *));
if (interfaces.iface == NULL) {
- wpa_printf(MSG_ERROR, "malloc failed\n");
+ wpa_printf(MSG_ERROR, "malloc failed");
return -1;
}