]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix crash that can occur if CLI registration fails for an aliased command.
authorMark Michelson <mmichelson@digium.com>
Tue, 11 Dec 2012 20:48:16 +0000 (20:48 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 11 Dec 2012 20:48:16 +0000 (20:48 +0000)
commit38253a70d25b502a65b3d7a93b0eabde421d67bb
tree01ce2382dcb321bdbef3075ad2e68e762ff72901
parenteef822a302e56790566a3353a7f469642a8b6fb2
Fix crash that can occur if CLI registration fails for an aliased command.

A recent memory leak fix in main/cli.c causes an ast_cli_entry's command
field to be freed and NULLed if ast_cli_register() fails. res_clialiases
was ignoring the return value of ast_cli_register() and was then passing
the NULL command off to a a hash function. This resulted in a crash.

The fix is not to ignore the erroneous return value. If ast_cli_register()
fails, then we do not continue trying to process the current alias.
........

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

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