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/messages.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/lib/messages.c') diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 2d6518aed6..cd2a3b36b6 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -69,6 +69,24 @@ static struct dispatch_fns { void (*fn)(int msg_type, struct process_id pid, void *buf, size_t len); } *dispatch_fns; +/**************************************************************************** + Free global objects. +****************************************************************************/ + +void gfree_messsges(void) +{ + struct dispatch_fns *dfn, *next; + + /* delete the dispatch_fns list */ + dfn = dispatch_fns; + while( dfn ) { + next = dfn->next; + DLIST_REMOVE(dispatch_fns, dfn); + SAFE_FREE(dfn); + dfn = next; + } +} + /**************************************************************************** Notifications come in as signals. ****************************************************************************/ -- cgit