res_clialiases: Fix crash when reloading and re-aliasing an alias that is in use.
authorJoshua Colp <jcolp@digium.com>
Tue, 4 Feb 2014 02:22:28 +0000 (02:22 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 4 Feb 2014 02:22:28 +0000 (02:22 +0000)
commit61aa7ce7f73e29194ff3b70268deeb4f89613495
tree12eca53980cb60baeeee992d3c7fd52097ae0547
parenta744b29ab5561185929f861744dbdd0af477eabc
res_clialiases: Fix crash when reloading and re-aliasing an alias that is in use.

The code assumed that unregistering the alias would always succeed while in
practice this is not actually true. A common case is the "reload" command itself.
If the cli_aliases.conf configuration file was changed and reload executed the
command would fail to unregister and ultimately point to freed memory.

The reload process now checks whether unregistering succeeded or not and if not
the old CLI alias is retained.

(closes issue ASTERISK-19773)
Reported by: Joel Vandal

(closes issue ASTERISK-22757)
Reported by: Gareth Blades
........

Merged revisions 407205 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 407210 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 407213 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_clialiases.c