summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ex_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ex_data.c')
-rw-r--r--src/lib/libcrypto/ex_data.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ex_data.c b/src/lib/libcrypto/ex_data.c
index d8d25d320e..5cd01c72d1 100644
--- a/src/lib/libcrypto/ex_data.c
+++ b/src/lib/libcrypto/ex_data.c
@@ -424,7 +424,7 @@ int_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
424 CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA); 424 CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA);
425 mx = sk_CRYPTO_EX_DATA_FUNCS_num(item->meth); 425 mx = sk_CRYPTO_EX_DATA_FUNCS_num(item->meth);
426 if (mx > 0) { 426 if (mx > 0) {
427 storage = malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS*)); 427 storage = reallocarray(NULL, mx, sizeof(CRYPTO_EX_DATA_FUNCS*));
428 if (!storage) 428 if (!storage)
429 goto skip; 429 goto skip;
430 for (i = 0; i < mx; i++) 430 for (i = 0; i < mx; i++)
@@ -468,7 +468,7 @@ int_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from)
468 if (j < mx) 468 if (j < mx)
469 mx = j; 469 mx = j;
470 if (mx > 0) { 470 if (mx > 0) {
471 storage = malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS*)); 471 storage = reallocarray(NULL, mx, sizeof(CRYPTO_EX_DATA_FUNCS*));
472 if (!storage) 472 if (!storage)
473 goto skip; 473 goto skip;
474 for (i = 0; i < mx; i++) 474 for (i = 0; i < mx; i++)
@@ -505,7 +505,7 @@ int_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
505 CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA); 505 CRYPTO_r_lock(CRYPTO_LOCK_EX_DATA);
506 mx = sk_CRYPTO_EX_DATA_FUNCS_num(item->meth); 506 mx = sk_CRYPTO_EX_DATA_FUNCS_num(item->meth);
507 if (mx > 0) { 507 if (mx > 0) {
508 storage = malloc(mx * sizeof(CRYPTO_EX_DATA_FUNCS*)); 508 storage = reallocarray(NULL, mx, sizeof(CRYPTO_EX_DATA_FUNCS*));
509 if (!storage) 509 if (!storage)
510 goto skip; 510 goto skip;
511 for (i = 0; i < mx; i++) 511 for (i = 0; i < mx; i++)