aboutsummaryrefslogtreecommitdiffstats
path: root/main/pbx.c
diff options
context:
space:
mode:
authoreliel <eliel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-16 18:43:19 +0000
committereliel <eliel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-16 18:43:19 +0000
commit16878a251803ad028ee6e9e70aca40625ee0ea56 (patch)
tree2f90c193c6f0d4740601ef64e0679b2affe88cc2 /main/pbx.c
parent894ed448c36d0ce4c31346ac52d0af6568a31a29 (diff)
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. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@194946 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 534dc4c0b..256e9c37f 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -5055,6 +5055,7 @@ int ast_register_application2(const char *app, int (*execute)(struct ast_channel
}
if (ast_string_field_init(tmp, 128)) {
+ AST_RWLIST_UNLOCK(&apps);
ast_free(tmp);
return -1;
}
@@ -6345,11 +6346,7 @@ int ast_unregister_application(const char *app)
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;
}