cvs: php-src /main network.c
| From: | Antony Dovgal | Date: | Mon, 20 Jun 2005 23:16:29 +0000 |
| Subject: | cvs: php-src /main network.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-32436@lists.php.net to get a copy of this message | ||
tony2001 Mon Jun 20 19:16:29 2005 EDT
Modified files:
/php-src/main network.c
Log:
fix memleak when connection fails (and we still keep trying)
http://cvs.php.net/diff.php/php-src/main/network.c?r1=1.116&r2=1.117&ty=u
Index: php-src/main/network.c
diff -u php-src/main/network.c:1.116 php-src/main/network.c:1.117
--- php-src/main/network.c:1.116 Tue Jun 14 09:09:04 2005
+++ php-src/main/network.c Mon Jun 20 19:16:27 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: network.c,v 1.116 2005/06/14 13:09:04 iliaa Exp $ */
+/* $Id: network.c,v 1.117 2005/06/20 23:16:27 tony2001 Exp $ */
/*#define DEBUG_MAIN_NETWORK 1*/
@@ -817,7 +817,13 @@
bad_ip:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid IP Address: %s", bindto);
}
-bind_done:
+bind_done:
+ /* free error string recieved during previous iteration (if any) */
+ if (error_string && *error_string) {
+ efree(*error_string);
+ *error_string = NULL;
+ }
+
n = php_network_connect_socket(sock, sa, socklen, asynchronous,
timeout ? &working_timeout : NULL,
error_string, error_code);