[asterisk-commits] eliel: branch 1.6.2 r194946 - in /branches/1.6.2: ./ main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat May 16 13:43:23 CDT 2009


Author: eliel
Date: Sat May 16 13:43:19 2009
New Revision: 194946

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=194946
Log:
Merged revisions 194945 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r194945 | eliel | 2009-05-16 14:32:11 -0400 (Sat, 16 May 2009) | 8 lines
  
  Fix a missing unlock in case of error, and a missing free().
  
  Always free the allocated memory for a string field, because
  we are always using it (not only when xmldocs are enabled).
  Also if there is an error allocating memory for the string field
  remember to unlock the list of registered applications, before returning.
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/pbx.c

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

Modified: branches/1.6.2/main/pbx.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/main/pbx.c?view=diff&rev=194946&r1=194945&r2=194946
==============================================================================
--- branches/1.6.2/main/pbx.c (original)
+++ branches/1.6.2/main/pbx.c Sat May 16 13:43:19 2009
@@ -5055,6 +5055,7 @@
 	}
 
 	if (ast_string_field_init(tmp, 128)) {
+		AST_RWLIST_UNLOCK(&apps);
 		ast_free(tmp);
 		return -1;
 	}
@@ -6345,11 +6346,7 @@
 			unreference_cached_app(tmp);
 			AST_RWLIST_REMOVE_CURRENT(list);
 			ast_verb(2, "Unregistered application '%s'\n", tmp->name);
-#ifdef AST_XML_DOCS
-			if (tmp->docsrc == AST_XML_DOC) {
-				ast_string_field_free_memory(tmp);
-			}
-#endif
+			ast_string_field_free_memory(tmp);
 			ast_free(tmp);
 			break;
 		}




More information about the asterisk-commits mailing list