]> git.kaiwu.me - nginx.git/commitdiff
Core: improved ngx_pstrdup() error handling.
authorTatsuhiko Kubo <cubicdaiya@gmail.com>
Fri, 1 Aug 2014 11:04:14 +0000 (20:04 +0900)
committerTatsuhiko Kubo <cubicdaiya@gmail.com>
Fri, 1 Aug 2014 11:04:14 +0000 (20:04 +0900)
src/core/ngx_conf_file.c

index d6b5cdf1e2b82f4ec0edde3991f67404f209829d..ec3c1fae1d94a4aea7b108f7af5720295d40fa41 100644 (file)
@@ -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);