[asterisk-commits] pcadach: branch pcadach/chan_h323-live r41197 - in /team/pcadach/chan_h323-li...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Aug 26 12:55:33 MST 2006


Author: pcadach
Date: Sat Aug 26 14:55:32 2006
New Revision: 41197

URL: http://svn.digium.com/view/asterisk?rev=41197&view=rev
Log:
Merged revisions 41196 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r41196 | kpfleming | 2006-08-27 01:45:16 +0600 (Вск, 27 Авг 2006) | 2 lines

ensure that unload_dynamic_module won't continue dereferencing a module pointer after the module has been unloaded from memory

........

Modified:
    team/pcadach/chan_h323-live/   (props changed)
    team/pcadach/chan_h323-live/main/loader.c

Propchange: team/pcadach/chan_h323-live/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Aug 26 14:55:32 2006
@@ -1,1 +1,1 @@
-/trunk:1-41193
+/trunk:1-41193,41196

Modified: team/pcadach/chan_h323-live/main/loader.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/main/loader.c?rev=41197&r1=41196&r2=41197&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/main/loader.c (original)
+++ team/pcadach/chan_h323-live/main/loader.c Sat Aug 26 14:55:32 2006
@@ -323,9 +323,14 @@
 #if LOADABLE_MODULES
 static void unload_dynamic_module(struct ast_module *mod)
 {
-	if (mod->lib)
-		while (!dlclose(mod->lib));
-	/* WARNING: the structure pointed to by mod is now gone! */
+	void *lib = mod->lib;
+
+	/* WARNING: the structure pointed to by mod is going to
+	   disappear when this operation succeeds, so we can't
+	   dereference it */
+
+	if (lib)
+		while (!dlclose(lib));
 }
 
 static struct ast_module *load_dynamic_module(const char *resource_in, unsigned int global_symbols_only)



More information about the asterisk-commits mailing list