[asterisk-commits] russell: branch 1.6.0 r131073 - in /branches/1.6.0: ./ res/res_agi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 15 13:47:12 CDT 2008


Author: russell
Date: Tue Jul 15 13:47:12 2008
New Revision: 131073

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

........
r131072 | russell | 2008-07-15 13:46:40 -0500 (Tue, 15 Jul 2008) | 5 lines

Fix a couple of places in res_agi where the agi_commands lock would not be
released, causing a deadlock.  (Reported by mvanbaak in #asterisk-dev,
discovered by bbryant's change to the lock tracking code to yell at you
if a thread exits with a lock still held)

........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/res/res_agi.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/res/res_agi.c?view=diff&rev=131073&r1=131072&r2=131073
==============================================================================
--- branches/1.6.0/res/res_agi.c (original)
+++ branches/1.6.0/res/res_agi.c Tue Jul 15 13:47:12 2008
@@ -2452,8 +2452,10 @@
 			if (!e->cmda[y] && !exact)
 				break;
 			/* don't segfault if the next part of a command doesn't exist */
-			if (!e->cmda[y])
+			if (!e->cmda[y]) {
+				AST_RWLIST_UNLOCK(&agi_commands);
 				return NULL;
+			}
 			if (strcasecmp(e->cmda[y], cmds[y]))
 				match = 0;
 		}
@@ -2461,8 +2463,10 @@
 		   a candidate (unless we're looking for a really inexact answer  */
 		if ((exact > -1) && e->cmda[y])
 			match = 0;
-		if (match)
+		if (match) {
+			AST_RWLIST_UNLOCK(&agi_commands);
 			return e;
+		}
 	}
 	AST_RWLIST_UNLOCK(&agi_commands);
 	return NULL;




More information about the asterisk-commits mailing list