RAND: close the correct file descriptor

This commit is contained in:
hasufell 2014-04-15 13:43:03 +02:00
parent f6e879cba8
commit 255bc5b769
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ static mp_digit get_urnd_int_small(int *sign)
random_data = open("/dev/urandom", O_RDONLY);
if ((result = read(random_data, &random_int, sizeof(random_int))) < 0)
NTRU_ABORT("Unable to read /dev/urandom");
close(random_int);
close(random_data);
if ((random_int % 2) == 0) {
random_int = 0;