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>
This commit is contained in:
Jouni Malinen 2015-09-05 11:41:49 +03:00
parent 8065377199
commit ebf05623c4

View file

@ -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,6 +1025,8 @@ out:
eloop_destroy();
out2:
if (daemonize)
os_daemonize_terminate(pid_file);
os_free(pid_file);
os_program_deinit();