Skip to content

Commit

Permalink
Fix resource leak
Browse files Browse the repository at this point in the history
Cherry-picked from: a8ae0b2
  • Loading branch information
Dag Robole authored and xanimo committed Jun 18, 2024
1 parent 60bd389 commit 90d1972
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ void GetDevURandom(unsigned char *ent32)
do {
ssize_t n = read(f, ent32 + have, NUM_OS_RANDOM_BYTES - have);
if (n <= 0 || n + have > NUM_OS_RANDOM_BYTES) {
close(f);
RandFailure();
}
have += n;
Expand Down

0 comments on commit 90d1972

Please sign in to comment.