diff --git a/ngx_rtmp_enotify_module.c b/ngx_rtmp_enotify_module.c index d62c83a..d74588a 100644 --- a/ngx_rtmp_enotify_module.c +++ b/ngx_rtmp_enotify_module.c @@ -12,10 +12,6 @@ #include "ngx_rtmp_record_module.h" #include -#ifdef HAVE_MALLOC_H -#include -#endif - #ifdef NGX_LINUX #include #endif @@ -261,7 +257,8 @@ ngx_rtmp_enotify_exec(ngx_rtmp_session_t *s, ngx_rtmp_enotify_conf_t *ec) case 0: /* child */ - args = malloc((ec->args.nelts + 2) * sizeof(char *)); + args = ngx_palloc(s->connection->pool, + (ec->args.nelts + 2) * sizeof(char *)); if (args == NULL) { exit(1); } diff --git a/ngx_rtmp_exec_module.c b/ngx_rtmp_exec_module.c index ed5bed6..1069256 100644 --- a/ngx_rtmp_exec_module.c +++ b/ngx_rtmp_exec_module.c @@ -6,9 +6,6 @@ #include "ngx_rtmp_cmd_module.h" #include "ngx_rtmp_eval.h" #include -#ifdef HAVE_MALLOC_H -#include -#endif #ifdef NGX_LINUX #include @@ -340,7 +337,8 @@ ngx_rtmp_exec_run(ngx_rtmp_session_t *s, size_t n) case 0: /* child */ - args = malloc((ec->args.nelts + 2) * sizeof(char *)); + args = ngx_palloc(s->connection->pool, + (ec->args.nelts + 2) * sizeof(char *)); if (args == NULL) { exit(1); }