From 255bc5b7698848e663992d0d2444afa242e84ca3 Mon Sep 17 00:00:00 2001 From: hasufell Date: Tue, 15 Apr 2014 13:43:03 +0200 Subject: [PATCH] RAND: close the correct file descriptor --- src/rand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rand.c b/src/rand.c index 960c2e9..7ec3f26 100644 --- a/src/rand.c +++ b/src/rand.c @@ -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;