From bbf666e447132a5f6b206ddf9ca918298b756392 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 8 Apr 2006 17:25:31 +0000 Subject: r15003: patch based on code from Arkady Glabek 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) --- source3/lib/util.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index 0fbe4a13d3..bfc5eb2a8d 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -179,6 +179,31 @@ static BOOL set_my_netbios_names(const char *name, int i) return True; } +/*********************************************************************** + Free memory allocated to global objects +***********************************************************************/ + +void gfree_names(void) +{ + SAFE_FREE( smb_myname ); + SAFE_FREE( smb_myworkgroup ); + SAFE_FREE( smb_scope ); + free_netbios_names_array(); +} + +void gfree_all( void ) +{ + gfree_names(); + gfree_loadparm(); + gfree_case_tables(); + gfree_debugsyms(); + gfree_charcnv(); + gfree_messsges(); + + /* release the talloc null_context memory last */ + talloc_nc_free(); +} + const char *my_netbios_names(int i) { return smb_my_netbios_names[i]; -- cgit