para_filter: Call proper ->free_config method on shutdown.
[paraslash.git] / filter.c
index 81258a6a12b51459d21ec00bad628bae009fa015..38122977f4bad9f0982fe30594e4f36c50c64176 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -161,13 +161,14 @@ out_cleanup:
                f = filters + fn->filter_num;
                if (f->close)
                        f->close(fn);
-               btr_free_node(fn->btrn);
-               free(fn->conf);
+               btr_remove_node(&fn->btrn);
+               if (f->free_config)
+                       f->free_config(fn->conf);
                free(fn);
        }
        free(fns);
-       btr_free_node(sit->btrn);
-       btr_free_node(sot->btrn);
+       btr_remove_node(&sit->btrn);
+       btr_remove_node(&sot->btrn);
 out:
        if (ret < 0)
                PARA_EMERG_LOG("%s\n", para_strerror(-ret));