aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_agent.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-19 15:49:19 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-19 15:49:19 +0000
commit5e39b0bfe18f108612d817601b2a57acf9706ae8 (patch)
treea50216e7b0169958f6b94466356b2e183f7d91db /channels/chan_agent.c
parent8f4137875de30d52bc9195d94a90abad5692609d (diff)
Merged revisions 143609 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r143609 | mmichelson | 2008-09-19 10:43:28 -0500 (Fri, 19 Sep 2008) | 11 lines We should only unsubscribe to the device state event subscription if we have previously subscribed. Otherwise a segfault will occur. (closes issue #13476) Reported by: jonnt Patches: 13476.patch uploaded by putnopvut (license 60) Tested by: jonnt ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@143611 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_agent.c')
-rw-r--r--channels/chan_agent.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 5f5afbd43..13d98cb83 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -2522,7 +2522,9 @@ static int unload_module(void)
/* First, take us out of the channel loop */
ast_channel_unregister(&agent_tech);
/* Delete devicestate subscription */
- agent_devicestate_sub = ast_event_unsubscribe(agent_devicestate_sub);
+ if (agent_devicestate_sub) {
+ agent_devicestate_sub = ast_event_unsubscribe(agent_devicestate_sub);
+ }
/* Unregister dialplan functions */
ast_custom_function_unregister(&agent_function);
/* Unregister CLI commands */