1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00

fix memleak when connection fails (and we still keep trying)

This commit is contained in:
Antony Dovgal
2005-06-20 23:16:27 +00:00
parent cf0c7a9f5a
commit 79d649e173

View File

@@ -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);