Skip to content

Commit

Permalink
fixed crash if missing rtmp{} block in config; thanks to @Freexer
Browse files Browse the repository at this point in the history
  • Loading branch information
arut committed Feb 5, 2013
1 parent 6d5986a commit 8104bff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ngx_rtmp_exec_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion ngx_rtmp_relay_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8104bff

Please sign in to comment.