[asterisk-commits] eliel: branch group/appdocsxml r137185 - /team/group/appdocsxml/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 11 07:27:24 CDT 2008


Author: eliel
Date: Mon Aug 11 07:27:24 2008
New Revision: 137185

URL: http://svn.digium.com/view/asterisk?view=rev&rev=137185
Log:
Prevent a crash if no language is defined in an application node.


Modified:
    team/group/appdocsxml/main/pbx.c

Modified: team/group/appdocsxml/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/main/pbx.c?view=diff&rev=137185&r1=137184&r2=137185
==============================================================================
--- team/group/appdocsxml/main/pbx.c (original)
+++ team/group/appdocsxml/main/pbx.c Mon Aug 11 07:27:24 2008
@@ -2814,11 +2814,12 @@
 		if (node) {
 			/* Check language */
 			lang = ast_xml_get_attribute(node, "language");
-			if (!strcmp(lang, language)) {
+			if (lang && !strcmp(lang, language)) {
 				ast_xml_free_attr(lang);
 				break;
-			}
-			ast_xml_free_attr(lang);
+			} else if (lang) {
+				ast_xml_free_attr(lang);
+			}
 			node = node->AST_XML_NEXT;
 		}
 	}




More information about the asterisk-commits mailing list