src/server/daemon/config.c

changeset 79
f48cea237ec3
parent 77
f1cff81e425a
child 83
28433f06d5ee
--- a/src/server/daemon/config.c	Tue Jun 25 22:18:59 2013 +0200
+++ b/src/server/daemon/config.c	Wed Jun 26 15:09:54 2013 +0200
@@ -93,8 +93,8 @@
         char *func_name = pblock_findval("fn", d->param);
         d->func = get_function(func_name);
         if(d->func == NULL) {
+            pblock_free(d->param);
             free(d);
-            pblock_free(d->param);
             //dirs = dirs->next;
             log_ereport(
                     LOG_MISCONFIG,
@@ -110,9 +110,13 @@
                     LOG_FAILURE,
                     "Error running Init function %s",
                     func_name);
+            pblock_free(d->param);
+            free(d);
             return 1;
         }
-
+        
+        pblock_free(d->param);
+        free(d);
         dirs = dirs->next;
     }
     
@@ -150,6 +154,10 @@
      * VirtualServer (dependencies: Listener)
      */
     
+    /*
+     * free stuff on error
+     */
+    
     // init logfile first
     UcxList *lfl = ucx_map_sstr_get(serverconf->objects, sstrn("LogFile", 7));
     if(lfl != NULL) {
@@ -257,7 +265,8 @@
 
         ls = ls->next;
     }
-
+    
+    free_server_config(serverconf);
     return serverconfig;
 }
 
@@ -790,6 +799,7 @@
         mime_conf_unref(old_conf);
     }
     
+    free_mime_config(mimecfg);
     return 0;
 }
 

mercurial