handle null values.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9733 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
7519c48b13
commit
ca4f65841a
|
@ -589,7 +589,7 @@ SWITCH_STANDARD_API(start_local_stream_function)
|
||||||
|
|
||||||
for (directory = switch_xml_child(cfg, "directory"); directory; directory = directory->next) {
|
for (directory = switch_xml_child(cfg, "directory"); directory; directory = directory->next) {
|
||||||
char *name = (char *) switch_xml_attr(directory, "name");
|
char *name = (char *) switch_xml_attr(directory, "name");
|
||||||
if (strcasecmp(name, local_stream_name)){
|
if (!name || !local_stream_name || strcasecmp(name, local_stream_name)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -629,7 +629,7 @@ SWITCH_STANDARD_API(start_local_stream_function)
|
||||||
"Interval must be multipe of 10 and less than %d, Using default of 20\n", SWITCH_MAX_INTERVAL);
|
"Interval must be multipe of 10 and less than %d, Using default of 20\n", SWITCH_MAX_INTERVAL);
|
||||||
}
|
}
|
||||||
} else if (!strcasecmp(var, "timer-name")) {
|
} else if (!strcasecmp(var, "timer-name")) {
|
||||||
timer_name = switch_core_strdup(source->pool, val);
|
timer_name = strdup(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -667,7 +667,7 @@ SWITCH_STANDARD_API(start_local_stream_function)
|
||||||
source->rate = rate;
|
source->rate = rate;
|
||||||
source->interval = interval;
|
source->interval = interval;
|
||||||
source->channels = channels;
|
source->channels = channels;
|
||||||
source->timer_name = switch_core_strdup(source->pool,timer_name);
|
source->timer_name = switch_core_strdup(source->pool, timer_name);
|
||||||
source->prebuf = prebuf;
|
source->prebuf = prebuf;
|
||||||
source->stopped = 0;
|
source->stopped = 0;
|
||||||
|
|
||||||
|
@ -685,10 +685,10 @@ SWITCH_STANDARD_API(start_local_stream_function)
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
stream->write_function(stream, "-USAGE: %s\n", START_LOCAL_STREAM_SYNTAX);
|
stream->write_function(stream, "-USAGE: %s\n", START_LOCAL_STREAM_SYNTAX);
|
||||||
switch_safe_free(mycmd);
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
|
switch_safe_free(timer_name);
|
||||||
switch_safe_free(mycmd);
|
switch_safe_free(mycmd);
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue