[asterisk-commits] mjordan: branch 11 r375802 - in /branches/11: ./ main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Nov 3 22:09:30 CDT 2012


Author: mjordan
Date: Sat Nov  3 22:09:26 2012
New Revision: 375802

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=375802
Log:
Don't attempt to purge sessions when no sessions exist

Manager's tcp/tls objects have a periodic function that purge old manager
sessions periodically.  During shutdown, the underlying container holding
those sessions can be disposed of and set to NULL before the tcp/tls periodic
function is stopped.  If the periodic function fires, it will attempt to
iterate over a NULL container.

This patch checks for whether or not the sessions container exists before
attempting to purge sessions out of it.  If the sessions container is NULL,
we simply return.

Note that this error was also caught by the Asterisk Test Suite.
........

Merged revisions 375800 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 375801 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    branches/11/   (props changed)
    branches/11/main/manager.c

Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: branches/11/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/manager.c?view=diff&rev=375802&r1=375801&r2=375802
==============================================================================
--- branches/11/main/manager.c (original)
+++ branches/11/main/manager.c Sat Nov  3 22:09:26 2012
@@ -5480,6 +5480,10 @@
 	time_t now = time(NULL);
 	struct ao2_iterator i;
 
+	if (!sessions) {
+		return;
+	}
+
 	i = ao2_iterator_init(sessions, 0);
 	while ((session = ao2_iterator_next(&i)) && n_max > 0) {
 		ao2_lock(session);




More information about the asterisk-commits mailing list