com php-src: Close fd at the end, otherwise people complain: ext/mcrypt/mcrypt.c

From: Date: Wed, 13 May 2015 12:18:32 +0000
Subject: com php-src: Close fd at the end, otherwise people complain: ext/mcrypt/mcrypt.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-86735@lists.php.net to get a copy of this message
Commit: f7952b90cad735e2a588c305d425c24550b3775d Author: Leigh <leigh@php.net> Fri, 27 Mar 2015 20:14:33 +0100 Committer: Julien Pauli <jpauli@php.net> Wed, 13 May 2015 14:18:32 +0200 Parents: c02c4aca007199057201b855f674b6baa9be4c6e Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f7952b90cad735e2a588c305d425c24550b3775d Log: Close fd at the end, otherwise people complain Even though it's closed when the process terminates! Changed paths: M ext/mcrypt/mcrypt.c Diff: diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 5f14a92..194660d 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -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; }

« previous php.cvs (#86735) next »