On May 28, 2014, at 10:49 PM, David Majnemer <[email protected]> wrote:

> 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.

LGTM - please commit.
[ open returns the smallest “non-negative integer” available ]

— Marshall



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

Reply via email to