goto end;
}
- irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row space");
+ irow = app_malloc_array(DB_NUMBER + 1, sizeof(*irow), "row space");
for (i = 0; i < DB_NUMBER; i++)
irow[i] = row[i];
irow[DB_NUMBER] = NULL;
goto end;
}
- irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row ptr");
+ irow = app_malloc_array(DB_NUMBER + 1, sizeof(*irow), "row ptr");
for (i = 0; i < DB_NUMBER; i++)
irow[i] = row[i];
irow[DB_NUMBER] = NULL;
EC_builtin_curve *curves = NULL;
size_t n, crv_len = EC_get_builtin_curves(NULL, 0);
- curves = app_malloc((int)sizeof(*curves) * crv_len, "list curves");
+ curves = app_malloc_array(crv_len, sizeof(*curves), "list curves");
EC_get_builtin_curves(curves, crv_len);
for (n = 0; n < crv_len; n++) {
return;
if (numfds == 0)
return;
- fds = app_malloc(sizeof(OSSL_ASYNC_FD) * numfds, "allocate async fds");
+ fds = app_malloc_array(numfds, sizeof(*fds), "allocate async fds");
if (!SSL_get_all_async_fds(s, fds, &numfds)) {
OPENSSL_free(fds);
return;
strerror(errno));
exit(1);
}
- kidpids = app_malloc(n_responders * sizeof(*kidpids), "child PID array");
+ kidpids = app_malloc_array(n_responders, sizeof(*kidpids),
+ "child PID array");
for (i = 0; i < n_responders; ++i)
kidpids[i] = 0;
ngroups = SSL_get1_groups(s, NULL);
if (ngroups <= 0)
return 1;
- groups = app_malloc(ngroups * sizeof(int), "groups to print");
+ groups = app_malloc_array(ngroups, sizeof(*groups), "groups to print");
SSL_get1_groups(s, groups);
BIO_puts(out, "Supported groups: ");
keysize = EVP_PKEY_get_size(pkey);
- rsa_in = app_malloc(keysize * 2, "hold rsa key");
+ rsa_in = app_malloc_array(2, keysize, "hold rsa key");
rsa_out = app_malloc(keysize, "output rsa key");
rsa_outlen = keysize;
loopargs_len = (async_jobs == 0 ? 1 : async_jobs);
loopargs =
- app_malloc(loopargs_len * sizeof(loopargs_t), "array of loopargs");
+ app_malloc_array(loopargs_len, sizeof(loopargs_t), "array of loopargs");
memset(loopargs, 0, loopargs_len * sizeof(loopargs_t));
buflen = lengths[size_num - 1];
int status;
static char sep[] = ":";
- fds = app_malloc(sizeof(*fds) * multi, "fd buffer for do_multi");
+ fds = app_malloc_array(multi, sizeof(*fds), "fd buffer for do_multi");
for (n = 0; n < multi; ++n) {
if (pipe(fd) == -1) {
BIO_printf(bio_err, "pipe failure\n");
char **irow;
int i;
- irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row pointers");
+ irow = app_malloc_array(DB_NUMBER + 1, sizeof(*irow), "row pointers");
for (i = 0; i < DB_NUMBER; i++)
irow[i] = row[i];
irow[DB_NUMBER] = NULL;