Prevent heap alloc functions from running out of stack space.
authorWalter Doekes <walter+asterisk@wjd.nu>
Fri, 16 Aug 2013 07:18:51 +0000 (07:18 +0000)
committerWalter Doekes <walter+asterisk@wjd.nu>
Fri, 16 Aug 2013 07:18:51 +0000 (07:18 +0000)
commitc43e19e8e5fc5bc133f2ce3eeafbf9ce07048bd1
tree3109874227e570a721bdd7f670a3f43a8ee39b4f
parent812355db8282eac83ddcd1969aea5bdd334e63a8
Prevent heap alloc functions from running out of stack space.

When asterisk has run out of memory (for whatever reason), the alloc
function logs a message. Logging requires memory. A recipe for
infinite recursion.

Stop the recursion by comparing the function call depth for sane values
before attempting another OOM log message.

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

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