Issue #27776: dev_urandom(raise=0) now closes the file descriptor on error

This commit is contained in:
Victor Stinner 2016-08-16 18:27:44 +02:00
parent 6974cf2c27
commit 3ee933f1c3
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}