Issue #27776: dev_urandom(raise=0) now closes the file descriptor on error
diff --git a/Python/random.c b/Python/random.c
index 511070a..6fdce64 100644
--- a/Python/random.c
+++ b/Python/random.c
@@ -331,6 +331,7 @@
 
             if (n <= 0) {
                 /* stop on error or if read(size) returned 0 */
+                close(fd);
                 return -1;
             }