diff options
| author | Antony Dovgal <tony2001@php.net> | 2005-06-20 23:16:27 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2005-06-20 23:16:27 +0000 |
| commit | 79d649e17323f4fa6bd234f4cdf609a99e91435a (patch) | |
| tree | dd47aa6caba6eee2180ea88d49199dbcd20a1651 | |
| parent | cf0c7a9f5a72bb01c331fec9d062795c57ff8e60 (diff) | |
| download | php-git-79d649e17323f4fa6bd234f4cdf609a99e91435a.tar.gz | |
fix memleak when connection fails (and we still keep trying)
| -rw-r--r-- | main/network.c | 8 |
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); |
