Make wpa_ctrl_close() handle unopened connection
This commit is contained in:
parent
28878f8b0e
commit
36fde1e79c
1 changed files with 4 additions and 1 deletions
|
@ -127,7 +127,10 @@ try_again:
|
||||||
|
|
||||||
void wpa_ctrl_close(struct wpa_ctrl *ctrl)
|
void wpa_ctrl_close(struct wpa_ctrl *ctrl)
|
||||||
{
|
{
|
||||||
|
if (ctrl == NULL)
|
||||||
|
return;
|
||||||
unlink(ctrl->local.sun_path);
|
unlink(ctrl->local.sun_path);
|
||||||
|
if (ctrl->s >= 0)
|
||||||
close(ctrl->s);
|
close(ctrl->s);
|
||||||
os_free(ctrl);
|
os_free(ctrl);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue