iliaa Sun Oct 23 11:29:38 2005 EDT
Modified files:
/php-src/ext/standard dns.c
Log:
MFB51: Fixed memory leak on error.
http://cvs.php.net/diff.php/php-src/ext/standard/dns.c?r1=1.72&r2=1.73&ty=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.72 php-src/ext/standard/dns.c:1.73
--- php-src/ext/standard/dns.c:1.72 Fri Oct 21 09:48:07 2005
+++ php-src/ext/standard/dns.c Sun Oct 23 11:29:38 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dns.c,v 1.72 2005/10/21 13:48:07 tony2001 Exp $ */
+/* $Id: dns.c,v 1.73 2005/10/23 15:29:38 iliaa Exp $ */
/* {{{ includes */
#include "php.h"
@@ -358,7 +358,7 @@
#endif /* QFIXEDSZ */
#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 256
+#define MAXHOSTNAMELEN 1024
#endif /* MAXHOSTNAMELEN */
#ifndef MAXRESOURCERECORDS
@@ -755,12 +755,14 @@
if (n<0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"res_nmkquery() failed");
zval_dtor(return_value);
+ res_nclose(&res);
RETURN_FALSE;
}
n = res_nsend(&res, buf.qb2, n, answer.qb2, sizeof
answer);
if (n<0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"res_nsend() failed");
zval_dtor(return_value);
+ res_nclose(&res);
RETURN_FALSE;
}
@@ -778,6 +780,7 @@
if (n < 0) {
php_error_docref(NULL TSRMLS_CC,
E_WARNING, "Unable to parse DNS data received");
zval_dtor(return_value);
+ res_nclose(&res);
RETURN_FALSE;
}
cp += n + QFIXEDSZ;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php