char **tmp;
arg->size += 20;
- tmp = OPENSSL_realloc(arg->argv, sizeof(*arg->argv) * arg->size);
+ tmp = OPENSSL_realloc_array(arg->argv,
+ arg->size, sizeof(*arg->argv));
if (tmp == NULL)
return 0;
arg->argv = tmp;
if (opts == NULL)
return NULL;
- params = OPENSSL_zalloc(sizeof(OSSL_PARAM) * (sz + 1));
+ params = OPENSSL_calloc(sz + 1, sizeof(OSSL_PARAM));
if (params == NULL)
return NULL;
* get them when linking with all of libapps.a.
* See comment in test/build.info.
*/
- newargv = OPENSSL_malloc(sizeof(*newargv) * (count + 1));
+ newargv = OPENSSL_malloc_array(count + 1, sizeof(*newargv));
if (newargv == NULL)
return NULL;
BIO_printf(bio, "Invalid extension names: %s\n", ext_names);
goto end;
}
- if ((names = OPENSSL_malloc(sizeof(char *) * nn)) == NULL)
+ if ((names = OPENSSL_malloc_array(nn, sizeof(char *))) == NULL)
goto end;
parse_ext_names(tmp_ext_names, names);
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
ERR_clear_error();
- prediction_table = OPENSSL_zalloc(sizeof(FUZZER_VALUE) * 65537);
+ prediction_table = OPENSSL_calloc(65537, sizeof(FUZZER_VALUE));
if (prediction_table == NULL)
return -1;
fuzzer_table = ossl_ht_new(&fuzz_conf);
for (p = param; p != NULL && p->key != NULL; p++)
p_num++;
- fuzzed_parameters = OPENSSL_zalloc(sizeof(OSSL_PARAM) *(p_num + 1));
+ fuzzed_parameters = OPENSSL_calloc(p_num + 1, sizeof(OSSL_PARAM));
p = fuzzed_parameters;
for (; param != NULL && param->key != NULL; param++) {
const char *sep = "\t ,";
/* Reserve an extra terminal slot with fmt == NULL */
- if ((ret = OPENSSL_zalloc((NUM_PKCS8_FORMATS + 1) * sizeof(*ret))) == NULL)
+ if ((ret = OPENSSL_calloc(NUM_PKCS8_FORMATS + 1, sizeof(*ret))) == NULL)
return NULL;
/* Entries that match a format will get a non-zero preference. */
void **t;
ARGON2_THREAD_DATA *t_data;
- t = OPENSSL_zalloc(sizeof(void *)*ctx->lanes);
- t_data = OPENSSL_zalloc(ctx->lanes * sizeof(ARGON2_THREAD_DATA));
+ t = OPENSSL_calloc(ctx->lanes, sizeof(void *));
+ t_data = OPENSSL_calloc(ctx->lanes, sizeof(ARGON2_THREAD_DATA));
if (t == NULL || t_data == NULL)
goto fail;
return 0;
if (ctx->type != ARGON2_D)
- ctx->memory = OPENSSL_secure_zalloc(ctx->memory_blocks *
- sizeof(BLOCK));
+ ctx->memory = OPENSSL_secure_calloc(ctx->memory_blocks, sizeof(BLOCK));
else
- ctx->memory = OPENSSL_zalloc(ctx->memory_blocks *
- sizeof(BLOCK));
+ ctx->memory = OPENSSL_calloc(ctx->memory_blocks, sizeof(BLOCK));
if (ctx->memory == NULL) {
ERR_raise_data(ERR_LIB_PROV, PROV_R_INVALID_MEMORY_SIZE,