From: Travis Cross Date: Thu, 29 May 2014 14:10:44 +0000 (+0000) Subject: Fix potential dereference of null pointer X-Git-Tag: v1.4.5~2^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e66d24622ace62fec5fef2a4b22c74ed92baeaa4;p=thirdparty%2Ffreeswitch.git Fix potential dereference of null pointer The node could conceivably disappear before we grab the globals mutex and we'd get back a null pointer. --- diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 1d48e6f0a3..ce980ae2c0 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -1791,7 +1791,7 @@ static void *SWITCH_THREAD_FUNC outbound_enterprise_thread_run(switch_thread_t * switch_mutex_lock(globals.mutex); node = switch_core_hash_find(globals.fifo_hash, h->node_name); - switch_thread_rwlock_rdlock(node->rwlock); + if (node) switch_thread_rwlock_rdlock(node->rwlock); switch_mutex_unlock(globals.mutex); if (node) {