Skip to content

Commit ee92f38

Browse files
committed
Revert "fix unused variables"
This reverts commit 06195a2.
1 parent 2ca3e11 commit ee92f38

3 files changed

Lines changed: 4 additions & 18 deletions

File tree

wolfcrypt/src/aes.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11451,18 +11451,14 @@ int wc_AesInit_Label(Aes* aes, const char* label, void* heap, int devId)
1145111451
void wc_AesFree(Aes* aes)
1145211452
{
1145311453
void* heap;
11454-
#ifndef WOLFSSL_NO_MALLOC
1145511454
byte isAllocated;
11456-
#endif
1145711455

1145811456
if (aes == NULL) {
1145911457
return;
1146011458
}
1146111459

11462-
#ifndef WOLFSSL_NO_MALLOC
1146311460
heap = aes->heap;
1146411461
isAllocated = aes->isAllocated;
11465-
#endif
1146611462

1146711463
#ifdef WC_DEBUG_CIPHER_LIFECYCLE
1146811464
(void)wc_debug_CipherLifecycleFree(&aes->CipherLifecycleTag, heap, 1);
@@ -11536,7 +11532,6 @@ void wc_AesFree(Aes* aes)
1153611532
XFREE(aes, heap, DYNAMIC_TYPE_AES);
1153711533
}
1153811534
#endif
11539-
(void)heap;
1154011535

1154111536
}
1154211537

wolfcrypt/src/ed25519.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,16 +1026,13 @@ int wc_ed25519_init(ed25519_key* key)
10261026
void wc_ed25519_free(ed25519_key* key)
10271027
{
10281028
void* heap;
1029-
#ifndef WOLFSSL_NO_MALLOC
10301029
byte isAllocated = 0;
1031-
#endif
1030+
10321031
if (key == NULL)
10331032
return;
10341033

1035-
#ifndef WOLFSSL_NO_MALLOC
10361034
heap = key->heap;
10371035
isAllocated = key->isAllocated;
1038-
#endif
10391036

10401037
#ifdef WOLFSSL_ED25519_PERSISTENT_SHA
10411038
ed25519_hash_free(key, &key->sha);
@@ -1053,9 +1050,9 @@ void wc_ed25519_free(ed25519_key* key)
10531050
#ifndef WOLFSSL_NO_MALLOC
10541051
if (isAllocated) {
10551052
XFREE(key, heap, DYNAMIC_TYPE_ED25519);
1053+
(void)heap;
10561054
}
10571055
#endif
1058-
(void)heap;
10591056

10601057
}
10611058

wolfcrypt/src/hash.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,7 @@ int wc_HashInit_ex(wc_HashAlg* hash, enum wc_HashType type, void* heap,
712712
if (hash == NULL)
713713
return BAD_FUNC_ARG;
714714

715-
#ifndef WOLFSSL_NO_MALLOC
716715
hash->isAllocated = 0;
717-
#endif
718716
hash->type = type;
719717

720718
switch (type) {
@@ -1046,23 +1044,19 @@ int wc_HashFree(wc_HashAlg* hash, enum wc_HashType type)
10461044
{
10471045
int ret = WC_NO_ERR_TRACE(HASH_TYPE_E); /* Default to hash type error */
10481046
void* heap = NULL;
1049-
#ifndef WOLFSSL_NO_MALLOC
10501047
byte isAllocated = 0;
1051-
#endif
1048+
10521049
if (hash == NULL)
10531050
return BAD_FUNC_ARG;
10541051

1055-
10561052
#ifdef DEBUG_WOLFSSL
10571053
if (hash->type != type) {
10581054
WOLFSSL_MSG("Hash free type mismatch!");
10591055
return BAD_FUNC_ARG;
10601056
}
10611057
#endif
10621058

1063-
#ifndef WOLFSSL_NO_MALLOC
10641059
isAllocated = hash->isAllocated;
1065-
#endif
10661060

10671061
switch (type) {
10681062
case WC_HASH_TYPE_MD5:
@@ -1181,9 +1175,9 @@ int wc_HashFree(wc_HashAlg* hash, enum wc_HashType type)
11811175
#ifndef WOLFSSL_NO_MALLOC
11821176
if (isAllocated) {
11831177
XFREE(hash, heap, DYNAMIC_TYPE_HASHES);
1178+
(void)heap;
11841179
}
11851180
#endif
1186-
(void)heap;
11871181

11881182
return ret;
11891183
}

0 commit comments

Comments
 (0)