]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
clean up on exit because otherwise re-lex may not be possible
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 25 Aug 2009 15:37:02 +0000 (15:37 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 25 Aug 2009 15:37:02 +0000 (15:37 +0000)
git-svn-id: file:///svn/unbound/trunk@1786 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/daemon.c
util/config_file.c

index 6f17c7145ffa0be7bb8f450f0defe92ca9c187a3..a26a0eda5df82d13920c6fedcd4ec9e1f0363021 100644 (file)
@@ -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);
index 60e53242a89fbb08ea5a09231cbc38f3d612a43f..cccedbbad0a88adf829ad4ff02677bc03d4082ce 100644 (file)
@@ -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) {