From: Joshua Colp Date: Fri, 19 Sep 2014 19:50:29 +0000 (+0000) Subject: res_pjsip_notify: Fix crash on unload/load and don't say the module doesn't exist... X-Git-Tag: 12.6.0-rc1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2a784247f897fd5295949e5e58138dd4c18345b;p=thirdparty%2Fasterisk.git res_pjsip_notify: Fix crash on unload/load and don't say the module doesn't exist on reload. 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 --- diff --git a/res/res_pjsip_notify.c b/res/res_pjsip_notify.c index ab5c930bd6..58d703f593 100644 --- a/res/res_pjsip_notify.c +++ b/res/res_pjsip_notify.c @@ -770,13 +770,17 @@ static int load_module(void) static int reload_module(void) { - return aco_process_config(¬ify_cfg, 1) ? - AST_MODULE_LOAD_DECLINE : 0; + if (aco_process_config(¬ify_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(¬ify_cfg); return 0;