From: Antony Dovgal Date: Mon, 20 Jun 2005 23:16:54 +0000 (+0000) Subject: MFH: fix memleak X-Git-Tag: php-5.0.5RC1~147 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=758e9b813f37ac4530baaa52b2d2c1d3f6f30613;p=php MFH: fix memleak --- diff --git a/main/network.c b/main/network.c index 5be559b82c..3b90ab8c1d 100644 --- a/main/network.c +++ b/main/network.c @@ -783,8 +783,13 @@ php_socket_t php_network_connect_socket_to_host(const char *host, unsigned short } if (sa) { + /* free error string recieved during previous iteration (if any) */ + if (error_string && *error_string) { + efree(*error_string); + *error_string = NULL; + } + /* make a connection attempt */ - n = php_network_connect_socket(sock, sa, socklen, asynchronous, timeout ? &working_timeout : NULL, error_string, error_code);