Fix bug saving listener configuration.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 31 Dec 2006 21:06:53 +0000 (22:06 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 31 Dec 2006 21:06:53 +0000 (22:06 +0100)
NEWS
mods/listener.c

diff --git a/NEWS b/NEWS
index d8c5dbb08c2c61cc23e5ed9af09dfc7bcad57cca..0948a6ddb5e096c66a7106fdd2131ab0e24bc94e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,8 @@ Ctrlproxy 3.0.1 UNRELEASED
        
        * Fix endless loop in logging system when debug level is 
          set to 5 (reported by _static_).
+       
+       * listener configuration is no longer truncated at exit.
 
   PORTABILITY
   
index 6bc54546a070049610ad1dfabd9f9d0ea2af0fa6..361308b151971087e442e451c402dad29d3157f2 100644 (file)
@@ -252,8 +252,8 @@ static void update_config(struct global *global, const char *path)
        g_key_file_set_integer(global->config->keyfile, "listener", "autoport", autoport);
 
        filename = g_build_filename(path, "listener", NULL);
-       
-       if (!keyfile)
+
+       if (keyfile)
                keyfile = g_key_file_new();
 
        kf = keyfile;
@@ -384,11 +384,11 @@ static void load_config(struct global *global)
 
 static void fini_plugin(void)
 {
-       while(listeners) {
-               struct listener *l = listeners->data;
+       GList *gl;
+       for(gl = listeners; gl; gl = gl->next) {
+               struct listener *l = gl->data;
                if (l->active) 
                        stop_listener(l);
-               free_listener(l);
        }
 }