comparison src/core/ngx_resolver.c @ 4643:bc5f881323b8

Fixed potential null pointer dereference in ngx_resolver_create(). While here, improved error message.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 22 May 2012 13:12:14 +0000
parents 3171ec7d0d05
children 134ccdf44647
comparison
equal deleted inserted replaced
4642:c1eb924fb6fe 4643:bc5f881323b8
173 173
174 u.host = names[i]; 174 u.host = names[i];
175 u.port = 53; 175 u.port = 53;
176 176
177 if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) { 177 if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
178 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V: %s", &u.host, u.err); 178 if (u.err) {
179 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
180 "%s in resolver \"%V\"",
181 u.err, &u.host);
182 }
183
179 return NULL; 184 return NULL;
180 } 185 }
181 186
182 uc = ngx_array_push(&r->udp_connections); 187 uc = ngx_array_push(&r->udp_connections);
183 if (uc == NULL) { 188 if (uc == NULL) {