Avoid leaking the urandom fd

When Apache is reloaded, it unloads the extension, but the open file descriptor to /dev/urandom is left hanging around and is leaked. This fixes the bug.

Duplicate of https://github.com/jedisct1/libsodium-php/pull/173
This commit is contained in:
Keyur Govande 2018-06-04 15:22:50 -04:00 committed by Nikita Popov
parent 0bafb530d6
commit 695b8192c7

View File

@ -637,6 +637,7 @@ PHP_MINIT_FUNCTION(sodium)
PHP_MSHUTDOWN_FUNCTION(sodium)
{
randombytes_close();
return SUCCESS;
}