pbx: Fix off-nominal case where a freed extension may still be used.
authorJoshua Colp <jcolp@digium.com>
Wed, 12 Nov 2014 16:13:15 +0000 (16:13 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 12 Nov 2014 16:13:15 +0000 (16:13 +0000)
commitdbb8f0a9354f703392a88278acddb63fd221310b
tree11ab999004de98cdb52c95548c1cdab9b558b758
parent9f89b83269e613cf80501e9d7c4387c2acc4fd34
pbx: Fix off-nominal case where a freed extension may still be used.

If during the operation of adding an extension a priority is added but
fails it is possible for the extension to be freed but still exist in
the PBX core. If this occurs subsequent lookups may try to access the
extension and end up in freed memory.

This change removes the extension from the PBX core when the priority
addition fails and then frees the extension.

ASTERISK-24444 #close
Reported by: Leandro Dardini

Review: https://reviewboard.asterisk.org/r/4162/
........

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

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

Merged revisions 427711 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/pbx.c