From: Anthony Minessale Date: Fri, 14 Sep 2012 19:25:15 +0000 (-0500) Subject: fix crash in mod_fifo when deleting a node when its in use X-Git-Tag: v1.2.3^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bbc372c560a612d0219bbf27240f21e42c20530;p=thirdparty%2Ffreeswitch.git fix crash in mod_fifo when deleting a node when its in use --- diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 2ef5c7fca9..f500c4683a 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -1224,10 +1224,15 @@ static void *SWITCH_THREAD_FUNC ringall_thread_run(switch_thread_t *thread, void node_name = cbh->rows[0]->node_name; switch_mutex_lock(globals.mutex); - node = switch_core_hash_find(globals.fifo_hash, node_name); - switch_thread_rwlock_rdlock(node->rwlock); + if ((node = switch_core_hash_find(globals.fifo_hash, node_name))) { + switch_thread_rwlock_rdlock(node->rwlock); + } switch_mutex_unlock(globals.mutex); + if (!node) { + goto end; + } + for (i = 0; i < cbh->rowcount; i++) { struct call_helper *h = cbh->rows[i];