tony2001 Tue Oct 25 10:57:39 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard dns.c Log: MFH: apply workaround for the leak only when GLIBC is used http://cvs.php.net/diff.php/php-src/ext/standard/dns.c?r1=1.68.2.3&r2=1.68.2.4&ty=u Index: php-src/ext/standard/dns.c diff -u php-src/ext/standard/dns.c:1.68.2.3 php-src/ext/standard/dns.c:1.68.2.4 --- php-src/ext/standard/dns.c:1.68.2.3 Tue Oct 25 04:19:50 2005 +++ php-src/ext/standard/dns.c Tue Oct 25 10:57:39 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dns.c,v 1.68.2.3 2005/10/25 08:19:50 tony2001 Exp $ */ +/* $Id: dns.c,v 1.68.2.4 2005/10/25 14:57:39 tony2001 Exp $ */ /* {{{ includes */ #include "php.h" @@ -324,6 +324,9 @@ * res_thread_freeres() in glibc/resolv/res_init.c * __libc_res_nsend() in resolv/res_send.c * */ + +#ifdef __GLIBC__ +#define php_dns_free_res(__res__) _php_dns_free_res(__res__) static void _php_dns_free_res(struct __res_state res) { /* {{{ */ int ns; for (ns = 0; ns < MAXNS; ns++) { @@ -333,6 +336,9 @@ } } } /* }}} */ +#else +#define php_dns_free_res(__res__) +#endif /* {{{ php_parserr */ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int store, zval **subarray) @@ -653,7 +659,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "res_nmkquery() failed"); zval_dtor(return_value); res_nclose(&res); - _php_dns_free_res(res); + php_dns_free_res(res); RETURN_FALSE; } n = res_nsend(&res, buf.qb2, n, answer.qb2, sizeof answer); @@ -661,7 +667,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "res_nsend() failed"); zval_dtor(return_value); res_nclose(&res); - _php_dns_free_res(res); + php_dns_free_res(res); RETURN_FALSE; } @@ -680,7 +686,7 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to parse DNS data received"); zval_dtor(return_value); res_nclose(&res); - _php_dns_free_res(res); + php_dns_free_res(res); RETURN_FALSE; } cp += n + QFIXEDSZ; @@ -696,7 +702,7 @@ } } res_nclose(&res); - _php_dns_free_res(res); + php_dns_free_res(res); } }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php