Merge pull request #1483 from dgarske/winvs

Fixes for unused `heap` warnings
This commit is contained in:
toddouska
2018-04-06 09:01:49 -07:00
committed by GitHub
3 changed files with 37 additions and 23 deletions

10
src/tls.c Normal file → Executable file
View File

@ -919,6 +919,8 @@ static TLSX* TLSX_New(TLSX_Type type, void* data, void* heap)
{
TLSX* extension = (TLSX*)XMALLOC(sizeof(TLSX), heap, DYNAMIC_TYPE_TLSX);
(void)heap;
if (extension) {
extension->type = type;
extension->data = data;
@ -2886,6 +2888,8 @@ static int TLSX_SupportedCurve_New(SupportedCurve** curve, word16 name,
if (curve == NULL)
return BAD_FUNC_ARG;
(void)heap;
*curve = (SupportedCurve*)XMALLOC(sizeof(SupportedCurve), heap,
DYNAMIC_TYPE_TLSX);
if (*curve == NULL)
@ -2902,6 +2906,8 @@ static int TLSX_PointFormat_New(PointFormat** point, byte format, void* heap)
if (point == NULL)
return BAD_FUNC_ARG;
(void)heap;
*point = (PointFormat*)XMALLOC(sizeof(PointFormat), heap,
DYNAMIC_TYPE_TLSX);
if (*point == NULL)
@ -8917,6 +8923,7 @@ int TLSX_Parse(WOLFSSL* ssl, byte* input, word16 length, byte msgType,
WOLFSSL_METHOD* method =
(WOLFSSL_METHOD*) XMALLOC(sizeof(WOLFSSL_METHOD),
heap, DYNAMIC_TYPE_METHOD);
(void)heap;
if (method)
InitSSL_Method(method, MakeTLSv1());
return method;
@ -8933,6 +8940,7 @@ int TLSX_Parse(WOLFSSL* ssl, byte* input, word16 length, byte msgType,
WOLFSSL_METHOD* method =
(WOLFSSL_METHOD*) XMALLOC(sizeof(WOLFSSL_METHOD),
heap, DYNAMIC_TYPE_METHOD);
(void)heap;
if (method)
InitSSL_Method(method, MakeTLSv1_1());
return method;
@ -9034,6 +9042,7 @@ int TLSX_Parse(WOLFSSL* ssl, byte* input, word16 length, byte msgType,
WOLFSSL_METHOD* method =
(WOLFSSL_METHOD*) XMALLOC(sizeof(WOLFSSL_METHOD),
heap, DYNAMIC_TYPE_METHOD);
(void)heap;
if (method) {
InitSSL_Method(method, MakeTLSv1());
method->side = WOLFSSL_SERVER_END;
@ -9052,6 +9061,7 @@ int TLSX_Parse(WOLFSSL* ssl, byte* input, word16 length, byte msgType,
WOLFSSL_METHOD* method =
(WOLFSSL_METHOD*) XMALLOC(sizeof(WOLFSSL_METHOD),
heap, DYNAMIC_TYPE_METHOD);
(void)heap;
if (method) {
InitSSL_Method(method, MakeTLSv1_1());
method->side = WOLFSSL_SERVER_END;

2
wolfcrypt/src/ecc.c Normal file → Executable file
View File

@ -2404,6 +2404,8 @@ ecc_point* wc_ecc_new_point_h(void* heap)
{
ecc_point* p;
(void)heap;
p = (ecc_point*)XMALLOC(sizeof(ecc_point), heap, DYNAMIC_TYPE_ECC);
if (p == NULL) {
return NULL;

2
wolfcrypt/src/pwdbased.c Normal file → Executable file
View File

@ -459,6 +459,8 @@ int wc_PKCS12_PBKDF_ex(byte* output, const byte* passwd, int passLen,
byte B[PBKDF_DIGEST_SIZE];
#endif
(void)heap;
if (!iterations)
iterations = 1;