]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix potential dereference of null pointer
authorTravis Cross <tc@traviscross.com>
Thu, 29 May 2014 14:10:44 +0000 (14:10 +0000)
committerTravis Cross <tc@traviscross.com>
Thu, 29 May 2014 14:11:33 +0000 (14:11 +0000)
The node could conceivably disappear before we grab the globals mutex
and we'd get back a null pointer.

src/mod/applications/mod_fifo/mod_fifo.c

index 1d48e6f0a3674bd682344dd67eb04d53e5c83a08..ce980ae2c0d4aa12d69297552e671bffe2b80235 100644 (file)
@@ -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) {