diff --git a/ssl/internal.h b/ssl/internal.h index c8a96a43..fdd3cb56 100644 --- a/ssl/internal.h +++ b/ssl/internal.h @@ -181,13 +181,12 @@ struct SSL_HANDSHAKE; * Note: unlike |new|, this does not support non-public constructors. */ template T *New(Args &&... args) { - T *t = reinterpret_cast(OPENSSL_malloc(sizeof(T))); + void *t = OPENSSL_malloc(sizeof(T)); if (t == nullptr) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return nullptr; } - new (t) T(std::forward(args)...); - return t; + return new (t) T(std::forward(args)...); } /* Delete behaves like |delete| but uses |OPENSSL_free| to release memory.