From 1784f408bc128794a8b01e6b7177df26c43951a6 Mon Sep 17 00:00:00 2001 From: Markus Fischer Date: Wed, 1 May 2002 07:21:50 +0000 Subject: [PATCH] - MFH fix for socket_select() and some minor memory leak; NEWS entry follows. --- ext/sockets/sockets.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 93a76292c5..91860566a6 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -97,6 +97,9 @@ static int le_iov; static int le_socket; #define le_socket_name "Socket" +static unsigned char first_through_third_args_force_ref[] = +{3, BYREF_FORCE, BYREF_FORCE, BYREF_FORCE}; + static unsigned char second_and_third_args_force_ref[] = {3, BYREF_NONE, BYREF_FORCE, BYREF_FORCE}; @@ -118,7 +121,7 @@ function_entry sockets_functions[] = { PHP_FE(socket_iovec_fetch, NULL) PHP_FE(socket_iovec_add, NULL) PHP_FE(socket_iovec_delete, NULL) - PHP_FE(socket_select, NULL) + PHP_FE(socket_select, first_through_third_args_force_ref) PHP_FE(socket_create, NULL) PHP_FE(socket_create_listen, NULL) PHP_FE(socket_create_pair, NULL) @@ -480,7 +483,8 @@ int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC) { /* Destroy old array, add new one */ zend_hash_destroy(Z_ARRVAL_P(sock_array)); - + efree(Z_ARRVAL_P(sock_array)); + zend_hash_internal_pointer_reset(new_hash); Z_ARRVAL_P(sock_array) = new_hash; -- 2.40.0