From b422db1c8078c0501e0e1d3d2e95ec38fb986528 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Tue, 25 Aug 2009 15:37:02 +0000 Subject: [PATCH] clean up on exit because otherwise re-lex may not be possible git-svn-id: file:///svn/unbound/trunk@1786 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/daemon.c | 8 ++++++++ util/config_file.c | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/daemon/daemon.c b/daemon/daemon.c index 6f17c7145..a26a0eda5 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -67,6 +67,10 @@ static int sig_record_reload = 0; /** cleaner ssl memory freeup */ static void* comp_meth = NULL; #endif +#ifdef LEX_HAS_YYLEX_DESTROY +/** remove buffers for parsing and init */ +void ub_c_lex_destroy(void); +#endif /** used when no other sighandling happens, so we don't die * when multiple signals in quick succession are sent to us. @@ -507,6 +511,10 @@ daemon_delete(struct daemon* daemon) free(daemon->pidfile); free(daemon->env); free(daemon); +#ifdef LEX_HAS_YYLEX_DESTROY + /* lex cleanup */ + ub_c_lex_destroy(); +#endif /* libcrypto cleanup */ #if HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS sk_SSL_COMP_free(comp_meth); diff --git a/util/config_file.c b/util/config_file.c index 60e53242a..cccedbbad 100644 --- a/util/config_file.c +++ b/util/config_file.c @@ -61,10 +61,6 @@ int ub_c_lex(void); int ub_c_wrap(void); /** print error with file and line number */ void ub_c_error(const char *message); -#ifdef LEX_HAS_YYLEX_DESTROY -/** remove buffers for parsing and init */ -void ub_c_lex_destroy(void); -#endif /** init ports possible for use */ static void init_outgoing_availports(int* array, int num); @@ -477,9 +473,6 @@ config_read(struct config_file* cfg, const char* filename, const char* chroot) create_cfg_parser(cfg, fname, chroot); ub_c_in = in; ub_c_parse(); -#ifdef LEX_HAS_YYLEX_DESTROY - ub_c_lex_destroy(); -#endif fclose(in); if(cfg_parser->errors != 0) {