random_device::random_device(const string&) initializes one if it's members
with the result of a call to open.

However, it assumes that open can only validly return a file descriptor
greater than zero.

This results in random_device believing that it didn't successfully open
the device causing it to throw in it's constructor, this ends up leaking a
file descriptor.

The fix is simple, don't error on file descriptors which are zero.

Attachment: t.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to