From 159c33184407fbf1eaa060ddc88664a3d4b7c9ea Mon Sep 17 00:00:00 2001 From: krakjoe Date: Fri, 9 Jan 2015 07:45:21 +0000 Subject: [PATCH] optimization for bug report #68679 --- ext/standard/dns.c | 8 ++++---- ext/standard/php_dns.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 604e390ea38..ad085376b1a 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -323,12 +323,12 @@ typedef union { #if defined(__GLIBC__) && !defined(HAVE_DEPRECATED_DNS_FUNCS) #define php_dns_free_res(__res__) _php_dns_free_res(__res__) -static void _php_dns_free_res(struct __res_state res) { /* {{{ */ +static void _php_dns_free_res(struct __res_state *res) { /* {{{ */ int ns; for (ns = 0; ns < MAXNS; ns++) { - if (res._u._ext.nsaddrs[ns] != NULL) { - free (res._u._ext.nsaddrs[ns]); - res._u._ext.nsaddrs[ns] = NULL; + if (res->_u._ext.nsaddrs[ns] != NULL) { + free (res->_u._ext.nsaddrs[ns]); + res->_u._ext.nsaddrs[ns] = NULL; } } } /* }}} */ diff --git a/ext/standard/php_dns.h b/ext/standard/php_dns.h index f37bce539ac..af6c091881d 100644 --- a/ext/standard/php_dns.h +++ b/ext/standard/php_dns.h @@ -34,7 +34,7 @@ res_nsearch(res, dname, class, type, answer, anslen); #define php_dns_free_handle(res) \ res_nclose(res); \ - php_dns_free_res(*res) + php_dns_free_res(res) #elif defined(HAVE_RES_SEARCH) #define php_dns_search(res, dname, class, type, answer, anslen) \