tony2001 Thu May 12 12:27:06 2005 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/sockets sockets.c
/php-src NEWS
Log:
MFH: fix #33019 (socket errors cause memory leaks in php_strerror())
patch by jwozniak23 at poczta dot onet dot pl
http://cvs.php.net/diff.php/php-src/ext/sockets/sockets.c?r1=1.165.2.3&r2=1.165.2.4&ty=u
Index: php-src/ext/sockets/sockets.c
diff -u php-src/ext/sockets/sockets.c:1.165.2.3
php-src/ext/sockets/sockets.c:1.165.2.4
--- php-src/ext/sockets/sockets.c:1.165.2.3 Mon Feb 14 18:44:31 2005
+++ php-src/ext/sockets/sockets.c Thu May 12 12:27:05 2005
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sockets.c,v 1.165.2.3 2005/02/14 23:44:31 sniper Exp $ */
+/* $Id: sockets.c,v 1.165.2.4 2005/05/12 16:27:05 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -321,6 +321,10 @@
buf = hstrerror(error);
#else
{
+ if (SOCKETS_G(strerror_buf)) {
+ efree(SOCKETS_G(strerror_buf));
+ }
+
spprintf(&(SOCKETS_G(strerror_buf)), 0, "Host lookup
error %d", error);
buf = SOCKETS_G(strerror_buf);
}
@@ -335,6 +339,11 @@
if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, error, MAKELANGID(LANG_NEUTRAL,
SUBLANG_DEFAULT), (LPTSTR) &tmp, 0, NULL)) {
+
+ if (SOCKETS_G(strerror_buf)) {
+ efree(SOCKETS_G(strerror_buf));
+ }
+
SOCKETS_G(strerror_buf) = estrdup(tmp);
LocalFree(tmp);
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.381&r2=1.1760.2.382&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.381 php-src/NEWS:1.1760.2.382
--- php-src/NEWS:1.1760.2.381 Tue May 10 19:15:23 2005
+++ php-src/NEWS Thu May 12 12:27:06 2005
@@ -11,6 +11,8 @@
- Fixed ext/mysqli to allocate less memory when fetching bound params
of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey)
- Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey)
+- Fixed bug #33019 (socket errors cause memory leaks in php_strerror()).
+ (jwozniak23 at poczta dot onet dot pl, Tony).
- Fixed bug #32956 (mysql_bind_result() doesn't support MYSQL_TYPE_NULL).
(Georg)
- Fixed bug #32947 (Incorrect option for mysqli default password). (Georg)
- Fixed bug #32936 (http redirects URLs are not checked for control chars).
(Ilia)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php