diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-08-04 11:13:14 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-08-08 10:04:23 -0400 |
commit | bc0726e674df20691a67f92098fd165cbb0b91aa (patch) | |
tree | b65a52adb333bc2f7ee4a0a25eb6911c153bf35b /src/mongo/platform/random.cpp | |
parent | 5b71d07dfc97cef7e4b41ffacbf01f51fca55053 (diff) | |
download | mongo-bc0726e674df20691a67f92098fd165cbb0b91aa.tar.gz |
SERVER-30520 SecureRandom::create() should return a unique_ptr
Diffstat (limited to 'src/mongo/platform/random.cpp')
-rw-r--r-- | src/mongo/platform/random.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/platform/random.cpp b/src/mongo/platform/random.cpp index 8abcf67b978..910fac54b72 100644 --- a/src/mongo/platform/random.cpp +++ b/src/mongo/platform/random.cpp @@ -143,8 +143,8 @@ private: BCRYPT_ALG_HANDLE _algHandle; }; -SecureRandom* SecureRandom::create() { - return new WinSecureRandom(); +std::unique_ptr<SecureRandom> SecureRandom::create() { + return stdx::make_unique<WinSecureRandom>(); } #elif defined(__linux__) || defined(__sun) || defined(__APPLE__) || defined(__FreeBSD__) @@ -173,8 +173,8 @@ private: std::unique_ptr<std::ifstream> _in; }; -SecureRandom* SecureRandom::create() { - return new InputStreamSecureRandom("/dev/urandom"); +std::unique_ptr<SecureRandom> SecureRandom::create() { + return stdx::make_unique<InputStreamSecureRandom>("/dev/urandom"); } #elif defined(__OpenBSD__) @@ -188,8 +188,8 @@ public: } }; -SecureRandom* SecureRandom::create() { - return new Arc4SecureRandom(); +std::unique_ptr<SecureRandom> SecureRandom::create() { + return stdx::make_unique<Arc4SecureRandom>(); } #else |