# HG changeset patch # User carl # Date 1194550543 28800 # Node ID 26c29da3fbdf20cc80b28f88e8da157da4b7ba9b # Parent e4eb969dfc4af5c489fb89d0582fede84c9665e6 shutdown removes iptables entries that we added diff -r e4eb969dfc4a -r 26c29da3fbdf src/syslog2iptables.cpp --- 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; } diff -r e4eb969dfc4a -r 26c29da3fbdf src/syslogconfig.cpp --- 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) { diff -r e4eb969dfc4a -r 26c29da3fbdf src/syslogconfig.h --- 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();