fixed crash if missing rtmp{} block in config; thanks to @Freexer

This commit is contained in:
Roman Arutyunyan 2013-02-05 19:42:18 +04:00
parent 6d5986aa59
commit 8104bff06f
2 changed files with 3 additions and 3 deletions

View file

@ -306,8 +306,8 @@ ngx_rtmp_exec_init_process(ngx_cycle_t *cycle)
ngx_rtmp_exec_t *e;
ngx_uint_t n;
if (cmcf->servers.nelts == 0) {
return NGX_ERROR;
if (cmcf == NULL || cmcf->servers.nelts == 0) {
return NGX_OK;
}
/* execs are always started by the first worker */

View file

@ -1561,7 +1561,7 @@ ngx_rtmp_relay_init_process(ngx_cycle_t *cycle)
ngx_rtmp_listen_t *lst;
ngx_event_t **pevent, *event;
if (cmcf->listen.nelts == 0) {
if (cmcf == NULL || cmcf->listen.nelts == 0) {
return NGX_OK;
}