]> granicus.if.org Git - php/commitdiff
MFH: fix memleak
authorAntony Dovgal <tony2001@php.net>
Mon, 20 Jun 2005 23:16:54 +0000 (23:16 +0000)
committerAntony Dovgal <tony2001@php.net>
Mon, 20 Jun 2005 23:16:54 +0000 (23:16 +0000)
main/network.c

index 5be559b82c5c46cc4eae3bc7711a8b3bcca7c05e..3b90ab8c1d002085fad3bd0e1128044cd5163621 100644 (file)
@@ -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);