Skip to content

Commit 6685aa3

Browse files
committed
Ada: use XMALLOC and XFREE for dynamic allocation
1 parent cec63b5 commit 6685aa3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

wolfssl/wolfcrypt/types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,7 @@ enum {
13481348
DYNAMIC_TYPE_X509_ACERT = 103,
13491349
DYNAMIC_TYPE_OS_BUF = 104,
13501350
DYNAMIC_TYPE_ASCON = 105,
1351+
DYNAMIC_TYPE_SHA = 106,
13511352
DYNAMIC_TYPE_SNIFFER_SERVER = 1000,
13521353
DYNAMIC_TYPE_SNIFFER_SESSION = 1001,
13531354
DYNAMIC_TYPE_SNIFFER_PB = 1002,

wrapper/Ada/ada_binding.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ extern void ada_free_rsa (void* key)
155155

156156
extern void* ada_new_sha256 (void)
157157
{
158-
return malloc(sizeof(wc_Sha256));
158+
return XMALLOC(sizeof(wc_Sha256), NULL, DYNAMIC_TYPE_SHA);
159159
}
160160

161161
extern void ada_free_sha256 (void* sha256)
162162
{
163-
free(sha256);
163+
XFREE(sha256, NULL, DYNAMIC_TYPE_SHA);
164164
}
165165

166166

0 commit comments

Comments
 (0)