Modernize use of std::make_unique
[folly.git] / folly / ssl / detail / OpenSSLThreading.cpp
index 05b551a7ecc51c2cd453b892008c16d91b40aadd..f68f677bfbb28ac64f0f7b5fa5d0b43fb7f6ca36 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <folly/ssl/detail/OpenSSLThreading.h>
 
+#include <memory>
 #include <mutex>
 
 #include <folly/Portability.h>
@@ -152,7 +153,7 @@ static void dyn_destroy(struct CRYPTO_dynlock_value* lock, const char*, int) {
 
 void installThreadingLocks() {
   // static locking
-  locks().reset(new SSLLock[size_t(CRYPTO_num_locks())]);
+  locks() = std::make_unique<SSLLock[]>(size_t(CRYPTO_num_locks()));
   for (auto it : lockTypes()) {
     locks()[size_t(it.first)].lockType = it.second;
   }