diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-08-16 16:27:44 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-08-16 16:27:44 (GMT) |
commit | 3ee933f1c34755bb210e23942d22649a0c38bd23 (patch) | |
tree | c4b69c7ac3a36bdf948bfcf1a21d8d5c62a25944 /Python/random.c | |
parent | 6974cf2c2719a6bf1bc72b60077de6681c09a44f (diff) | |
download | cpython-3ee933f1c34755bb210e23942d22649a0c38bd23.zip cpython-3ee933f1c34755bb210e23942d22649a0c38bd23.tar.gz cpython-3ee933f1c34755bb210e23942d22649a0c38bd23.tar.bz2 |
Issue #27776: dev_urandom(raise=0) now closes the file descriptor on error
Diffstat (limited to 'Python/random.c')
-rw-r--r-- | Python/random.c | 1 |
1 files changed, 1 insertions, 0 deletions
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 @@ 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; } |