Raise an Err when CRYPTO_THREAD_lock_new fails
[openssl.git] / crypto / dh / dh_lib.c
index 8645b67..6a59f7f 100644 (file)
@@ -64,6 +64,7 @@ DH *DH_new_method(ENGINE *engine)
     ret->references = 1;
     ret->lock = CRYPTO_THREAD_lock_new();
     if (ret->lock == NULL) {
+        DHerr(DH_F_DH_NEW_METHOD, ERR_R_MALLOC_FAILURE);
         OPENSSL_free(ret);
         return NULL;
     }