Author: mikej Date: Wed May 21 18:00:30 2008 New Revision: 8512 Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Log: don't deref NULL. Found by Klockwork (www.klocwork.com) Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c ============================================================================== --- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (original) +++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Wed May 21 18:00:30 2008 @@ -740,13 +740,13 @@ pop = NULL; if (moh && do_wait) { - switch_status_t status = switch_ivr_play_file(session, NULL, moh, &args); + switch_status_t moh_status = switch_ivr_play_file(session, NULL, moh, &args); memset(&args, 0, sizeof(args)); args.read_frame_callback = consumer_read_frame_callback; args.user_data = node_list; switch_ivr_play_file(session, NULL, moh, &args); - if (!SWITCH_READ_ACCEPTABLE(status)) { + if (!SWITCH_READ_ACCEPTABLE(moh_status)) { break; } } @@ -1153,13 +1153,13 @@ if (!x) { stream->write_function(stream, "none\n"); } - } else { - if ((node = switch_core_hash_find(globals.fifo_hash, argv[1]))) { - len = node_consumer_wait_count(node); - } + } else if ((node = switch_core_hash_find(globals.fifo_hash, argv[1]))) { + len = node_consumer_wait_count(node); switch_mutex_lock(node->mutex); stream->write_function(stream, "%s:%d:%d:%d\n", argv[1], node->consumer_count, node->caller_count, len); switch_mutex_unlock(node->mutex); + } else { + stream->write_function(stream, "none\n"); } }