From 8b44ad7e162203db56056503d806246ee6a2ad0f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 27 Apr 2013 23:05:52 +0300 Subject: [PATCH] Use os_zalloc() instead of os_malloc() + os_memset() Signed-hostap: Jouni Malinen --- hostapd/config_file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index cd68e3ef9..21104d302 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -83,7 +83,7 @@ static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss, return -1; } - vlan = os_malloc(sizeof(*vlan)); + vlan = os_zalloc(sizeof(*vlan)); if (vlan == NULL) { wpa_printf(MSG_ERROR, "Out of memory while reading " "VLAN interfaces from '%s'", fname); @@ -91,7 +91,6 @@ static int hostapd_config_read_vlan_file(struct hostapd_bss_config *bss, return -1; } - os_memset(vlan, 0, sizeof(*vlan)); vlan->vlan_id = vlan_id; os_strlcpy(vlan->ifname, pos, sizeof(vlan->ifname)); if (bss->vlan_tail)