Use mbedtls_calloc, not regular calloc

Also fix the allocation size.

Signed-off-by: Max Fillinger <[email protected]>
This commit is contained in:
Max Fillinger
2025-04-16 11:24:50 +02:00
parent 2310c1970b
commit 6f7cf0e402
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -2583,7 +2583,7 @@ usage:
#if defined(MBEDTLS_SSL_KEYING_MATERIAL_EXPORT)
if (opt.exp_label != NULL && opt.exp_len > 0) {
unsigned char *exported_key = calloc((size_t) opt.exp_len, sizeof(unsigned int));
unsigned char *exported_key = mbedtls_calloc((size_t) opt.exp_len, sizeof(unsigned char));
if (exported_key == NULL) {
mbedtls_printf("Could not allocate %d bytes\n", opt.exp_len);
ret = 3;
+1 -1
View File
@@ -3665,7 +3665,7 @@ handshake:
#if defined(MBEDTLS_SSL_KEYING_MATERIAL_EXPORT)
if (opt.exp_label != NULL && opt.exp_len > 0) {
unsigned char *exported_key = calloc((size_t) opt.exp_len, sizeof(unsigned int));
unsigned char *exported_key = mbedtls_calloc((size_t) opt.exp_len, sizeof(unsigned char));
if (exported_key == NULL) {
mbedtls_printf("Could not allocate %d bytes\n", opt.exp_len);
ret = 3;