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,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue