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:
+4
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user