Remove memory leak from readRandomDevice by using a raw fd
authorBrian Watling <bwatling@fb.com>
Wed, 5 Nov 2014 23:17:10 +0000 (15:17 -0800)
committerPavlo Kushnir <pavlo@fb.com>
Sat, 8 Nov 2014 02:38:18 +0000 (18:38 -0800)
commit35654c7b2138b590cdc18898a9897b665d8a443e
tree3ffcb945243b414916b36273c4f1cbf51678cfeb
parent100ebad746bbc310bb56bfd1c11e6054970ab873
Remove memory leak from readRandomDevice by using a raw fd

Summary: Switch from dynamically allocating a File to using a raw fd for readRandomDevice. This prevents races at shutdown while also eliminating the memory leak

Test Plan: run unit tests

Reviewed By: meyering@fb.com

Subscribers: njormrod, folly-diffs@, tao-eng@

FB internal diff: D1662151

Signature: t1:1662151:1415229242:525b6294b27bb68b5dda70aadb8d3ba1cc61b815
folly/Random.cpp