fxed crash on NULL arg in netcall

This commit is contained in:
Roman Arutyunyan 2012-04-04 02:27:06 +04:00
parent d3c5ad1196
commit 498b505622

View file

@ -193,11 +193,13 @@ ngx_rtmp_netcall_create(ngx_rtmp_session_t *s, ngx_rtmp_netcall_init_t *ci)
}
/* copy arg to connection pool */
cs->arg = ngx_pcalloc(pool, ci->argsize);
if (cs->arg == NULL) {
goto error;
if (ci->argsize) {
cs->arg = ngx_pcalloc(pool, ci->argsize);
if (cs->arg == NULL) {
goto error;
}
ngx_memcpy(cs->arg, ci->arg, ci->argsize);
}
ngx_memcpy(cs->arg, ci->arg, ci->argsize);
cs->url = ci->url;
cs->session = s;