Skip to content

Commit

Permalink
Fix resource leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Dag Robole authored and xanimo committed Apr 3, 2024
1 parent dc70f27 commit 5bc1349
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 @@ -185,6 +185,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 5bc1349

Please sign in to comment.