aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/wpa_ctrl.c
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-02-27 15:07:07 (GMT)
committerJouni Malinen <j@w1.fi>2011-02-27 15:07:07 (GMT)
commit36fde1e79cd226a91ce2ae56ff065c409790d5d7 (patch)
tree536061defa7408e580d3ace8772e35a0d75d8a35 /src/common/wpa_ctrl.c
parent28878f8b0eacd3826bc43a659d3c33aacd9ff03e (diff)
downloadhostap-36fde1e79cd226a91ce2ae56ff065c409790d5d7.zip
hostap-36fde1e79cd226a91ce2ae56ff065c409790d5d7.tar.gz
hostap-36fde1e79cd226a91ce2ae56ff065c409790d5d7.tar.bz2
Make wpa_ctrl_close() handle unopened connection
Diffstat (limited to 'src/common/wpa_ctrl.c')
-rw-r--r--src/common/wpa_ctrl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c
index 81fe6ba..c151934 100644
--- a/src/common/wpa_ctrl.c
+++ b/src/common/wpa_ctrl.c
@@ -127,8 +127,11 @@ try_again:
void wpa_ctrl_close(struct wpa_ctrl *ctrl)
{
+ if (ctrl == NULL)
+ return;
unlink(ctrl->local.sun_path);
- close(ctrl->s);
+ if (ctrl->s >= 0)
+ close(ctrl->s);
os_free(ctrl);
}