changeset 38:26c29da3fbdf

shutdown removes iptables entries that we added
author carl
date Thu, 08 Nov 2007 11:35:43 -0800
parents e4eb969dfc4a
children a9101672c0e9
files src/syslog2iptables.cpp src/syslogconfig.cpp src/syslogconfig.h
diffstat 3 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/syslog2iptables.cpp	Thu Nov 08 11:07:05 2007 -0800
+++ b/src/syslog2iptables.cpp	Thu Nov 08 11:35:43 2007 -0800
@@ -223,6 +223,7 @@
         if (config) {
             config->dump();
             delete config;
+            clear_strings();    // for valgrind checking
             return 0;
         }
         else {
@@ -291,6 +292,7 @@
         my_syslog("failed to detach config loader thread");
 
     worker();
+    clear_strings();    // for valgrind checking
 
     return EXIT_SUCCESS;
 }
--- a/src/syslogconfig.cpp	Thu Nov 08 11:07:05 2007 -0800
+++ b/src/syslogconfig.cpp	Thu Nov 08 11:35:43 2007 -0800
@@ -487,6 +487,14 @@
 
 
 ////////////////////////////////////////////////
+// clear all global strings, helper for valgrind checking
+//
+void clear_strings() {
+	discard(all_strings);
+}
+
+
+////////////////////////////////////////////////
 //
 bool tsa(TOKEN &tok, char *token);
 bool tsa(TOKEN &tok, char *token) {
--- a/src/syslogconfig.h	Thu Nov 08 11:07:05 2007 -0800
+++ b/src/syslogconfig.h	Thu Nov 08 11:35:43 2007 -0800
@@ -88,6 +88,7 @@
 void discard(string_set &s);
 char* register_string(string_set &s, char *name);
 char* register_string(char *name);
+void  clear_strings();
 int   ip_address(char *have);
 bool  load_conf(CONFIG &dc, char *fn);
 void  token_init();