]> granicus.if.org Git - php/commitdiff
Close fd at the end, otherwise people complain
authorLeigh <leigh@php.net>
Fri, 27 Mar 2015 19:14:33 +0000 (20:14 +0100)
committerJulien Pauli <jpauli@php.net>
Wed, 13 May 2015 12:18:32 +0000 (14:18 +0200)
Even though it's closed when the process terminates!

ext/mcrypt/mcrypt.c

index 5f14a9274d0dace76ec1deb795a96c7b102a0097..194660d864eaf3fb40ce9b77e60a63b145251b24 100644 (file)
@@ -491,6 +491,14 @@ static PHP_MSHUTDOWN_FUNCTION(mcrypt) /* {{{ */
        php_stream_filter_unregister_factory("mcrypt.*" TSRMLS_CC);
        php_stream_filter_unregister_factory("mdecrypt.*" TSRMLS_CC);
 
+       if (MCG(fd[RANDOM]) > 0) {
+               close(MCG(fd[RANDOM]));
+       }
+
+       if (MCG(fd[URANDOM]) > 0) {
+               close(MCG(fd[URANDOM]));
+       }
+
        UNREGISTER_INI_ENTRIES();
        return SUCCESS;
 }