aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_priv.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-09-05 08:41:49 (GMT)
committerJouni Malinen <j@w1.fi>2015-09-05 08:41:49 (GMT)
commitebf05623c4a3867a1e04235bc87cb205bab83967 (patch)
treebd27a3faf5cea6fa298ff772b9a121cc10ee05d8 /wpa_supplicant/wpa_priv.c
parent80653771991197876918b4ea357c4f43e4b181b5 (diff)
downloadhostap-ebf05623c4a3867a1e04235bc87cb205bab83967.zip
hostap-ebf05623c4a3867a1e04235bc87cb205bab83967.tar.gz
hostap-ebf05623c4a3867a1e04235bc87cb205bab83967.tar.bz2
wpa_priv: Fix early exit path
eloop_destroy() cannot be called before eloop_init() have been called successfully. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wpa_priv.c')
-rw-r--r--wpa_supplicant/wpa_priv.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c
index 4611a1d..dd43122 100644
--- a/wpa_supplicant/wpa_priv.c
+++ b/wpa_supplicant/wpa_priv.c
@@ -982,20 +982,20 @@ int main(int argc, char *argv[])
break;
default:
usage();
- goto out;
+ goto out2;
}
}
if (optind >= argc) {
usage();
- goto out;
+ goto out2;
}
wpa_printf(MSG_DEBUG, "wpa_priv control directory: '%s'", ctrl_dir);
if (eloop_init()) {
wpa_printf(MSG_ERROR, "Failed to initialize event loop");
- goto out;
+ goto out2;
}
for (i = optind; i < argc; i++) {
@@ -1025,7 +1025,9 @@ out:
eloop_destroy();
- os_daemonize_terminate(pid_file);
+out2:
+ if (daemonize)
+ os_daemonize_terminate(pid_file);
os_free(pid_file);
os_program_deinit();