if (ptr == NULL) {
ERR("g_malloc failed\n");
g_free(mac);
- mac = NULL;
return TRUE;
}
- ptr->mac_addr = mac;
- ptr->tid = g_timeout_add(HOSTAPD_DHCP_MAX_INTERVAL,
- __hostapd_connect_timer_cb, mac);
- sta_timer_list = g_slist_append(sta_timer_list, ptr);
- band_update_info_t *info = NULL;
- info = (band_update_info_t *)g_malloc(sizeof(band_update_info_t));
+ band_update_info_t * info = (band_update_info_t *)g_malloc(sizeof(band_update_info_t));
if (info == NULL) {
ERR("g_malloc failed\n");
g_free(mac);
- mac = NULL;
+ g_free(ptr);
return TRUE;
}
+
+ ptr->mac_addr = mac;
+ ptr->tid = g_timeout_add(HOSTAPD_DHCP_MAX_INTERVAL,
+ __hostapd_connect_timer_cb, mac);
+
+ sta_timer_list = g_slist_append(sta_timer_list, ptr);
info->mac_addr = g_strdup(mac);
info->band = (hostapd_monitor_fd[HOSTAPD_WIFI_BAND_2G] == *data_fd) ? HOSTAPD_WIFI_BAND_2G : HOSTAPD_WIFI_BAND_5G;
- g_free(mac);
- mac = NULL;
_add_mac_band_info(info);
} else if (!strncmp(pbuf, HOSTAPD_STA_DISCONN, HOSTAPD_STA_DISCONN_LEN)) {
*/
_destroy_dhcp_ack_timer(mac);
g_free(mac);
- mac = NULL;
discon_event = TRUE;
} else {