]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_misdn segfaults when DEBUG_THREADS is enabled.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 31 Mar 2011 20:11:40 +0000 (20:11 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 31 Mar 2011 20:11:40 +0000 (20:11 +0000)
commit32e0a3510c0c9f636d9e6cf94cfc4dfd6270f598
tree47e3d0e01e497e5497b4386ae50e3cd891e533e7
parent8439e8344cb90cf5edf734f75647fa35cb1dabc7
chan_misdn segfaults when DEBUG_THREADS is enabled.

The segfault happens because jb->mutexjb is uninitialized from the
ast_malloc().  The internals of ast_mutex_init() were assuming a nonzero
value meant mutex tracking initialization had already happened.  Recent
changes to mutex tracking code to reduce excessive memory consumption
exposed this uninitialized value.

Converted misdn_jb_init() to use ast_calloc() instead of ast_malloc().
Also eliminated redundant zero initialization code in the routine.

(closes issue #18975)
Reported by: irroot

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@312022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_misdn.c