com php-src: optimization for bug report #68679: ext/standard/dns.c ext/standard/php_dns.h
| From: | Joe Watkins | Date: | Fri, 09 Jan 2015 07:45:21 +0000 |
| Subject: | com php-src: optimization for bug report #68679: ext/standard/dns.c ext/standard/php_dns.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84039@lists.php.net to get a copy of this message | ||
Commit: 159c33184407fbf1eaa060ddc88664a3d4b7c9ea
Author: krakjoe <pthreads@pthreads.org> Fri, 9 Jan 2015 07:45:21 +0000
Parents: 8c9415e5d762202a560de9fe7a3fd640f2a966a3
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=159c33184407fbf1eaa060ddc88664a3d4b7c9ea
Log:
optimization for bug report #68679
Bugs:
https://bugs.php.net/68679
Changed paths:
M ext/standard/dns.c
M ext/standard/php_dns.h
Diff:
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index 604e390..ad08537 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 f37bce5..af6c091 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) \