Add forgotten list entry removal for control interface deinit

dl_list_del() must be called before freeing the list entries. Neither of
these cases caused problems because the full list data structure was
freed, but still, it is better to do this properly.

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-10-04 11:58:24 +03:00
parent d9052150eb
commit 12ea4cff6b

View file

@ -916,8 +916,10 @@ void wpa_supplicant_ctrl_iface_deinit(struct ctrl_iface_priv *priv)
free_dst: free_dst:
dl_list_for_each_safe(dst, prev, &priv->ctrl_dst, struct wpa_ctrl_dst, dl_list_for_each_safe(dst, prev, &priv->ctrl_dst, struct wpa_ctrl_dst,
list) list) {
dl_list_del(&dst->list);
os_free(dst); os_free(dst);
}
dl_list_for_each_safe(msg, prev_msg, &priv->msg_queue, dl_list_for_each_safe(msg, prev_msg, &priv->msg_queue,
struct ctrl_iface_msg, list) { struct ctrl_iface_msg, list) {
dl_list_del(&msg->list); dl_list_del(&msg->list);
@ -1422,8 +1424,10 @@ wpa_supplicant_global_ctrl_iface_deinit(struct ctrl_iface_global_priv *priv)
if (priv->global->params.ctrl_interface) if (priv->global->params.ctrl_interface)
unlink(priv->global->params.ctrl_interface); unlink(priv->global->params.ctrl_interface);
dl_list_for_each_safe(dst, prev, &priv->ctrl_dst, struct wpa_ctrl_dst, dl_list_for_each_safe(dst, prev, &priv->ctrl_dst, struct wpa_ctrl_dst,
list) list) {
dl_list_del(&dst->list);
os_free(dst); os_free(dst);
}
dl_list_for_each_safe(msg, prev_msg, &priv->msg_queue, dl_list_for_each_safe(msg, prev_msg, &priv->msg_queue,
struct ctrl_iface_msg, list) { struct ctrl_iface_msg, list) {
dl_list_del(&msg->list); dl_list_del(&msg->list);