summaryrefslogtreecommitdiff
path: root/main/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/network.c')
-rw-r--r--main/network.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/network.c b/main/network.c
index ae1941c257..7e66c1761b 100644
--- a/main/network.c
+++ b/main/network.c
@@ -817,7 +817,13 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short
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);