From 244a6a28b1dbfdc96d81f73568d5f24716660918 Mon Sep 17 00:00:00 2001 From: Tatsuhiko Kubo Date: Fri, 1 Aug 2014 20:04:14 +0900 Subject: [PATCH] Core: improved ngx_pstrdup() error handling. --- src/core/ngx_conf_file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c index d6b5cdf1e..ec3c1fae1 100644 --- a/src/core/ngx_conf_file.c +++ b/src/core/ngx_conf_file.c @@ -781,6 +781,9 @@ ngx_conf_include(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) file.len = name.len++; file.data = ngx_pstrdup(cf->pool, &name); + if (file.data == NULL) { + return NGX_CONF_ERROR; + } ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data);