diff --git a/src/ssl.c b/src/ssl.c index 5fcd828fd..0b494ac03 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -16133,6 +16133,7 @@ WOLFSSL_DH* wolfSSL_DH_new(void) if (wc_InitDhKey(key) != 0) { WOLFSSL_MSG("wolfSSL_DH_new InitDhKey failure"); XFREE(key, NULL, DYNAMIC_TYPE_DH); + XFREE(external, NULL, DYNAMIC_TYPE_DH); return NULL; } external->internal = key; diff --git a/wolfcrypt/src/integer.c b/wolfcrypt/src/integer.c index efa0af912..067a55012 100644 --- a/wolfcrypt/src/integer.c +++ b/wolfcrypt/src/integer.c @@ -330,7 +330,7 @@ int mp_copy (mp_int * a, mp_int * b) } /* grow dest */ - if (b->alloc < a->used) { + if (b->alloc < a->used || b->dp == NULL) { if ((res = mp_grow (b, a->used)) != MP_OKAY) { return res; } @@ -1633,7 +1633,7 @@ int s_mp_sub (mp_int * a, mp_int * b, mp_int * c) max_a = a->used; /* init result */ - if (c->alloc < max_a) { + if (c->alloc < max_a || c->dp == NULL) { if ((res = mp_grow (c, max_a)) != MP_OKAY) { return res; } diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index cf82ca674..532bf107e 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -78,6 +78,7 @@ int wolfCrypt_Init(void) WOLFSSL_MSG(ippGetStatusString(ret)); WOLFSSL_MSG("Using default fast IPP library"); ret = 0; + (void)ret; /* suppress not read warning */ } #endif