commit | be5cce4a3dc21ccdeaaa510cb01fdcff5f6716cc | [log] [tgz] |
---|---|---|
author | Dmitry Shmidt <dimitrysh@google.com> | Wed Nov 11 17:13:36 2009 -0800 |
committer | Dmitry Shmidt <dimitrysh@google.com> | Wed Nov 11 17:13:36 2009 -0800 |
tree | 8ede5411abba2e18a3b5c5253e959bdfae865ad7 | |
parent | cf3c05b78e8d0f3816f5b9611af18ec301e338d0 [diff] |
Check if interface is valid in wpa_ctrl_close() Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/wpa_ctrl.c b/wpa_ctrl.c index 32866cf..3c61b27 100644 --- a/wpa_ctrl.c +++ b/wpa_ctrl.c
@@ -140,8 +140,11 @@ 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); }