php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #66008
Patch php_fpm_socket_unix_file_descriptior_leak revision 2013-10-31 09:17 UTC by anthony dot fournier at ovh dot net

Patch php_fpm_socket_unix_file_descriptior_leak for FPM related Bug #66008

Patch version 2013-10-31 09:17 UTC

Return to Bug #66008 | Download this patch
Patch Revisions:

Developer: anthony.fournier@ovh.net

diff --git sapi/fpm/fpm/fpm_sockets.c sapi/fpm/fpm/fpm_sockets.c
index 0151243..ff8a9f4 100644
--- sapi/fpm/fpm/fpm_sockets.c
+++ sapi/fpm/fpm/fpm_sockets.c
@@ -500,6 +500,8 @@ int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen) /* {{
 	}
 
 	if (connect(fd, (struct sockaddr *)sock, socklen) == -1) {
+		// Connect failed : close the socket
+		close(fd);
 		return -1;
 	}
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 15:01:28 2024 UTC