diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2009-11-11 17:13:36 -0800 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2009-11-11 17:13:36 -0800 |
commit | be5cce4a3dc21ccdeaaa510cb01fdcff5f6716cc (patch) | |
tree | 8ede5411abba2e18a3b5c5253e959bdfae865ad7 | |
parent | cf3c05b78e8d0f3816f5b9611af18ec301e338d0 (diff) | |
download | wpa_supplicant-be5cce4a3dc21ccdeaaa510cb01fdcff5f6716cc.tar.gz |
Check if interface is valid in wpa_ctrl_close()
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | wpa_ctrl.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -140,8 +140,11 @@ struct wpa_ctrl * wpa_ctrl_open(const char *ctrl_path) 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); } |