diff --git a/Python/random.c b/Python/random.c index 511070add0a..6fdce64bca3 100644 --- a/Python/random.c +++ b/Python/random.c @@ -331,6 +331,7 @@ dev_urandom(char *buffer, Py_ssize_t size, int raise) if (n <= 0) { /* stop on error or if read(size) returned 0 */ + close(fd); return -1; }