1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 10:43:30 +02:00

Fix #28996: unix sockets leak when connection fails

This commit is contained in:
Wez Furlong
2004-07-02 17:23:07 +00:00
parent 8b504aad98
commit a7067ff166
+4 -1
View File
@@ -704,8 +704,11 @@ PHPAPI php_stream *_php_stream_sock_open_unix(const char *path, int pathlen, con
memcpy(unix_addr.sun_path, path, pathlen);
if (php_connect_nonb(socketd, (struct sockaddr *) &unix_addr, sizeof(unix_addr), timeout) == SOCK_CONN_ERR)
if (php_connect_nonb(socketd, (struct sockaddr *) &unix_addr,
sizeof(unix_addr), timeout) == SOCK_CONN_ERR) {
closesocket(socketd);
return NULL;
}
stream = php_stream_sock_open_from_socket_rel(socketd, persistent_id);
if (stream == NULL)