Skip to content

Commit f7952b9

Browse files
ltJulien Pauli
authored andcommitted
Close fd at the end, otherwise people complain
Even though it's closed when the process terminates!
1 parent c02c4ac commit f7952b9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ext/mcrypt/mcrypt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,14 @@ static PHP_MSHUTDOWN_FUNCTION(mcrypt) /* {{{ */
491491
php_stream_filter_unregister_factory("mcrypt.*" TSRMLS_CC);
492492
php_stream_filter_unregister_factory("mdecrypt.*" TSRMLS_CC);
493493

494+
if (MCG(fd[RANDOM]) > 0) {
495+
close(MCG(fd[RANDOM]));
496+
}
497+
498+
if (MCG(fd[URANDOM]) > 0) {
499+
close(MCG(fd[URANDOM]));
500+
}
501+
494502
UNREGISTER_INI_ENTRIES();
495503
return SUCCESS;
496504
}

0 commit comments

Comments
 (0)