Restoring the original core configuration during exiting that
authorMiklos Tirpak <miklos@iptel.org>
Thu, 3 Jan 2008 10:30:55 +0000 (10:30 +0000)
committerMiklos Tirpak <miklos@iptel.org>
Thu, 3 Jan 2008 10:30:55 +0000 (10:30 +0000)
makes the config variables available for farther function calls.
Closes SER-349

main.c

diff --git a/main.c b/main.c
index adb5f4e..85009c8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -476,6 +476,10 @@ void cleanup(show_status)
 #ifdef USE_DST_BLACKLIST
        destroy_dst_blacklist();
 #endif
+       /* restore the original core configuration before the
+        * config block is freed, otherwise even logging is unusable,
+        * it can case segfault */
+       core_cfg = &default_core_cfg;
        cfg_destroy();
 #ifdef USE_TCP
        destroy_tcp();