FS-8287 Fix segfault from refactor

This commit is contained in:
Brian West 2015-10-14 10:27:49 -05:00
parent ab0f1423fb
commit df8d8713fe
1 changed files with 4 additions and 4 deletions

View File

@ -1108,7 +1108,7 @@ SWITCH_STANDARD_API(local_stream_function)
local_stream_name = argv[1]; local_stream_name = argv[1];
if (!strcasecmp(argv[0], "hup")) { if (!strcasecmp(argv[0], "hup") && local_stream_name) {
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
source = switch_core_hash_find(globals.source_hash, local_stream_name); source = switch_core_hash_find(globals.source_hash, local_stream_name);
switch_mutex_unlock(globals.mutex); switch_mutex_unlock(globals.mutex);
@ -1118,7 +1118,7 @@ SWITCH_STANDARD_API(local_stream_function)
stream->write_function(stream, "+OK hup stream: %s", source->name); stream->write_function(stream, "+OK hup stream: %s", source->name);
goto done; goto done;
} }
} else if (!strcasecmp(argv[0], "stop")) { } else if (!strcasecmp(argv[0], "stop") && local_stream_name) {
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
source = switch_core_hash_find(globals.source_hash, local_stream_name); source = switch_core_hash_find(globals.source_hash, local_stream_name);
switch_mutex_unlock(globals.mutex); switch_mutex_unlock(globals.mutex);
@ -1130,7 +1130,7 @@ SWITCH_STANDARD_API(local_stream_function)
source->stopped = 1; source->stopped = 1;
stream->write_function(stream, "+OK"); stream->write_function(stream, "+OK");
} else if (!strcasecmp(argv[0], "reload")) { } else if (!strcasecmp(argv[0], "reload") && local_stream_name) {
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
source = switch_core_hash_find(globals.source_hash, local_stream_name); source = switch_core_hash_find(globals.source_hash, local_stream_name);
switch_mutex_unlock(globals.mutex); switch_mutex_unlock(globals.mutex);
@ -1143,7 +1143,7 @@ SWITCH_STANDARD_API(local_stream_function)
source->full_reload = 1; source->full_reload = 1;
source->part_reload = 1; source->part_reload = 1;
stream->write_function(stream, "+OK"); stream->write_function(stream, "+OK");
} else if (!strcasecmp(argv[0], "start")) { } else if (!strcasecmp(argv[0], "start") && local_stream_name) {
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
source = switch_core_hash_find(globals.source_hash, local_stream_name); source = switch_core_hash_find(globals.source_hash, local_stream_name);
switch_mutex_unlock(globals.mutex); switch_mutex_unlock(globals.mutex);