Skip to content

Commit

Permalink
Avoid leaking the urandom fd
Browse files Browse the repository at this point in the history
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 jedisct1/libsodium-php#173
  • Loading branch information
keyurdg authored and nikic committed Jun 8, 2018
1 parent 0bafb53 commit 695b819
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/sodium/libsodium.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ PHP_MINIT_FUNCTION(sodium)

PHP_MSHUTDOWN_FUNCTION(sodium)
{
randombytes_close();
return SUCCESS;
}

Expand Down

0 comments on commit 695b819

Please sign in to comment.