mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-07-25 01:58:41 +08:00
Use mbedtls_calloc, not regular calloc
Also fix the allocation size. Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
This commit is contained in:
parent
4e21703bcf
commit
22728dc5e3
@ -2508,7 +2508,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;
|
||||
|
@ -3628,7 +3628,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user