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:
parent
8065377199
commit
ebf05623c4
1 changed files with 6 additions and 4 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue