Skip to content

Commit

Permalink
Fix resource leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Dag Robole committed Jul 15, 2017
1 parent 10b22e3 commit a8ae0b2
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 @@ -191,6 +191,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 a8ae0b2

Please sign in to comment.