Don't call exit_control() if we didn't do init_control().
This commit is contained in:
parent
3b237afbda
commit
c64f64b875
1 changed files with 6 additions and 5 deletions
11
src/tincd.c
11
src/tincd.c
|
@ -92,7 +92,7 @@ char *logfilename = NULL; /* log file location */
|
||||||
char *controlcookiename = NULL;
|
char *controlcookiename = NULL;
|
||||||
char **g_argv; /* a copy of the cmdline arguments */
|
char **g_argv; /* a copy of the cmdline arguments */
|
||||||
|
|
||||||
static int status;
|
static int status = 1;
|
||||||
|
|
||||||
static struct option const long_options[] = {
|
static struct option const long_options[] = {
|
||||||
{"config", required_argument, NULL, 'c'},
|
{"config", required_argument, NULL, 'c'},
|
||||||
|
@ -434,10 +434,10 @@ int main2(int argc, char **argv) {
|
||||||
/* Setup sockets and open device. */
|
/* Setup sockets and open device. */
|
||||||
|
|
||||||
if(!setup_network())
|
if(!setup_network())
|
||||||
goto end;
|
goto end_nonet;
|
||||||
|
|
||||||
if(!init_control())
|
if(!init_control())
|
||||||
return 1;
|
goto end_nonet;
|
||||||
|
|
||||||
/* Initiate all outgoing connections. */
|
/* Initiate all outgoing connections. */
|
||||||
|
|
||||||
|
@ -488,10 +488,11 @@ int main2(int argc, char **argv) {
|
||||||
close_network_connections();
|
close_network_connections();
|
||||||
|
|
||||||
end:
|
end:
|
||||||
logger(LOG_NOTICE, "Terminating");
|
|
||||||
|
|
||||||
exit_control();
|
exit_control();
|
||||||
|
|
||||||
|
end_nonet:
|
||||||
|
logger(LOG_NOTICE, "Terminating");
|
||||||
|
|
||||||
crypto_exit();
|
crypto_exit();
|
||||||
|
|
||||||
exit_configuration(&config_tree);
|
exit_configuration(&config_tree);
|
||||||
|
|
Loading…
Reference in a new issue