summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/dh/dh_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/crypto/dh/dh_lib.c')
-rw-r--r--crypto/openssl/crypto/dh/dh_lib.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/crypto/openssl/crypto/dh/dh_lib.c b/crypto/openssl/crypto/dh/dh_lib.c
index 6c21463..a8d5340 100644
--- a/crypto/openssl/crypto/dh/dh_lib.c
+++ b/crypto/openssl/crypto/dh/dh_lib.c
@@ -96,16 +96,15 @@ DH *DH_new(void)
DH *DH_new_method(DH_METHOD *meth)
{
DH *ret;
- ret=(DH *)Malloc(sizeof(DH));
+ ret=(DH *)OPENSSL_malloc(sizeof(DH));
if (ret == NULL)
{
DHerr(DH_F_DH_NEW,ERR_R_MALLOC_FAILURE);
return(NULL);
}
- if(!default_DH_method) default_DH_method = DH_OpenSSL();
if(meth) ret->meth = meth;
- else ret->meth = default_DH_method;
+ else ret->meth = DH_get_default_method();
ret->pad=0;
ret->version=0;
ret->p=NULL;
@@ -123,7 +122,7 @@ DH *DH_new_method(DH_METHOD *meth)
ret->flags=ret->meth->flags;
if ((ret->meth->init != NULL) && !ret->meth->init(ret))
{
- Free(ret);
+ OPENSSL_free(ret);
ret=NULL;
}
else
@@ -156,11 +155,11 @@ void DH_free(DH *r)
if (r->g != NULL) BN_clear_free(r->g);
if (r->q != NULL) BN_clear_free(r->q);
if (r->j != NULL) BN_clear_free(r->j);
- if (r->seed) Free(r->seed);
+ if (r->seed) OPENSSL_free(r->seed);
if (r->counter != NULL) BN_clear_free(r->counter);
if (r->pub_key != NULL) BN_clear_free(r->pub_key);
if (r->priv_key != NULL) BN_clear_free(r->priv_key);
- Free(r);
+ OPENSSL_free(r);
}
int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
OpenPOWER on IntegriCloud