]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_notify: Fix crash on unload/load and don't say the module doesn't exist...
authorJoshua Colp <jcolp@digium.com>
Fri, 19 Sep 2014 19:50:29 +0000 (19:50 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 19 Sep 2014 19:50:29 +0000 (19:50 +0000)
When unloading the module did not unregister the CLI commands causing a crash upon
load when they were registered again.

When reloading the module the return value from the config options framework was not
checked to determine if an error occurred or not. This caused a message to be output
saying the module did not exist when reloading if no changes were present.

AST-1433 #close
AST-1434 #close

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@423579 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_pjsip_notify.c

index ab5c930bd629a4b1d623ae69bdeab165ea3b03a6..58d703f593571321f23f1db0ce74c54c24554e67 100644 (file)
@@ -770,13 +770,17 @@ static int load_module(void)
 
 static int reload_module(void)
 {
-       return aco_process_config(&notify_cfg, 1) ?
-               AST_MODULE_LOAD_DECLINE : 0;
+       if (aco_process_config(&notify_cfg, 1) == ACO_PROCESS_ERROR) {
+               return AST_MODULE_LOAD_DECLINE;
+       }
+
+       return 0;
 }
 
 static int unload_module(void)
 {
        ast_manager_unregister("PJSIPNotify");
+       ast_cli_unregister_multiple(cli_options, ARRAY_LEN(cli_options));
        aco_info_destroy(&notify_cfg);
 
        return 0;