diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-21 23:54:12 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-21 23:54:12 +0000 |
commit | b6e2980dd6796fabc2eba42b3db8d4b57513cb12 (patch) | |
tree | 0dc51f470ca68136426e22f709f308185e6121c2 /apps/app_dial.c | |
parent | 150b2c22ef3891af40e92cccbe05dbd3006e99a9 (diff) |
closes issue #11285, where an unload of a module that creates a dialplan context, causes a crash when you do a 'dialplan show' of that context. This is because the registrar string is defined in the module, and the stale pointer is traversed. The reporter offered a patch that would always strdup the registrar string, which is practical, but I preferred to destroy the created contexts in each module where one is created. That seemed more symmetric. There were only 6 place in asterisk where this is done: chan_sip, chan_iax2, chan_skinny, res_features, app_dial, and app_queue. The two apps destroyed the context, but left the contexts. All is fixed now and unloads should be dialplan friendly.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89513 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r-- | apps/app_dial.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c index a4d955778..714c38a85 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1953,8 +1953,11 @@ static int unload_module(void) res |= ast_unregister_application(rapp); if ((con = ast_context_find("app_dial_gosub_virtual_context"))) + { ast_context_remove_extension2(con, "s", 1, NULL); - + ast_context_destroy(con, "app_dial"); /* leave nothing behind */ + } + return res; } |