Skip to content

Commit 159c331

Browse files
committed
optimization for bug report #68679
1 parent 8c9415e commit 159c331

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ext/standard/dns.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,12 @@ typedef union {
323323

324324
#if defined(__GLIBC__) && !defined(HAVE_DEPRECATED_DNS_FUNCS)
325325
#define php_dns_free_res(__res__) _php_dns_free_res(__res__)
326-
static void _php_dns_free_res(struct __res_state res) { /* {{{ */
326+
static void _php_dns_free_res(struct __res_state *res) { /* {{{ */
327327
int ns;
328328
for (ns = 0; ns < MAXNS; ns++) {
329-
if (res._u._ext.nsaddrs[ns] != NULL) {
330-
free (res._u._ext.nsaddrs[ns]);
331-
res._u._ext.nsaddrs[ns] = NULL;
329+
if (res->_u._ext.nsaddrs[ns] != NULL) {
330+
free (res->_u._ext.nsaddrs[ns]);
331+
res->_u._ext.nsaddrs[ns] = NULL;
332332
}
333333
}
334334
} /* }}} */

ext/standard/php_dns.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
res_nsearch(res, dname, class, type, answer, anslen);
3535
#define php_dns_free_handle(res) \
3636
res_nclose(res); \
37-
php_dns_free_res(*res)
37+
php_dns_free_res(res)
3838

3939
#elif defined(HAVE_RES_SEARCH)
4040
#define php_dns_search(res, dname, class, type, answer, anslen) \

0 commit comments

Comments
 (0)