summaryrefslogtreecommitdiff
path: root/source3/lib/debug.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-04-08 17:25:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:55 -0500
commitbbf666e447132a5f6b206ddf9ca918298b756392 (patch)
tree3cac70deddd159edbd7fb3aece639c48e9a5e67e /source3/lib/debug.c
parentc9c502442b40aba97de17456ba948effcdfa3d05 (diff)
downloadsamba-bbf666e447132a5f6b206ddf9ca918298b756392.tar.gz
samba-bbf666e447132a5f6b206ddf9ca918298b756392.tar.bz2
samba-bbf666e447132a5f6b206ddf9ca918298b756392.zip
r15003: patch based on code from Arkady Glabek <aglabek@centeris.com> to ensure that global memory is freed when unloading pam_winbind.so (needs more testing on non-linux platforms)
(This used to be commit 1e0b79e591d70352a96e0a0487d8f394dc7b36ba)
Diffstat (limited to 'source3/lib/debug.c')
-rw-r--r--source3/lib/debug.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 97a147f17d..b8c42686cd 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -177,6 +177,27 @@ static char **classname_table = NULL;
* Functions...
*/
+/***************************************************************************
+ Free memory pointed to by global pointers.
+****************************************************************************/
+
+void gfree_debugsyms(void)
+{
+ int i;
+
+ if ( classname_table ) {
+ for ( i = 0; i < debug_num_classes; i++ ) {
+ SAFE_FREE( classname_table[i] );
+ }
+ SAFE_FREE( classname_table );
+ }
+
+ if ( DEBUGLEVEL_CLASS != &debug_all_class_hack )
+ SAFE_FREE( DEBUGLEVEL_CLASS );
+
+ if ( DEBUGLEVEL_CLASS_ISSET != &debug_all_class_isset_hack )
+ SAFE_FREE( DEBUGLEVEL_CLASS_ISSET );
+}
/****************************************************************************
utility lists registered debug class names's
@@ -510,7 +531,7 @@ void debug_init(void)
if (initialised)
return;
-
+
initialised = True;
message_register(MSG_DEBUG, debug_message);