pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[patch] php broken on Linux



Hi,

there is a recent patch in php55, php56 and php70
(patch-ext_standard_php__dns.h) to address a memory leak.
It replaces a call to res_nclose() with a call to res_ndestroy(), which
is not available in glibc.

Attached is an improved version of that patch, using res_ndestroy() only
on non-glibc systems.

I don't know if the memory leak existed with glibc and if I just
reintroduced it :-)


Regards
Matthias
$NetBSD$

--- ext/standard/php_dns.h.orig	2016-03-29 16:08:54.000000000 +0000
+++ ext/standard/php_dns.h
@@ -32,9 +32,15 @@
 #elif defined(HAVE_RES_NSEARCH)
 #define php_dns_search(res, dname, class, type, answer, anslen) \
 			res_nsearch(res, dname, class, type, answer, anslen);
+#ifdef __GLIBC__
 #define php_dns_free_handle(res) \
 			res_nclose(res); \
 			php_dns_free_res(*res)
+#else
+#define php_dns_free_handle(res) \
+			res_ndestroy(res); \
+			php_dns_free_res(*res)
+#endif
 
 #elif defined(HAVE_RES_SEARCH)
 #define php_dns_search(res, dname, class, type, answer, anslen) \


Home | Main Index | Thread Index | Old Index