Issue #27776: dev_urandom(raise=0) now closes the file descriptor on error
This commit is contained in:
parent
6974cf2c27
commit
3ee933f1c3
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue