#ifdef KSSL_DEBUG
printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers);
#endif /* KSSL_DEBUG */
- co_list = mallocarray(num_of_ciphers, sizeof(CIPHER_ORDER));
+ co_list = reallocarray(NULL, num_of_ciphers, sizeof(CIPHER_ORDER));
if (co_list == NULL) {
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE);
return(NULL); /* Failure */
*/
num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER);
num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
- ca_list = mallocarray(num_of_alias_max, sizeof(SSL_CIPHER *));
+ ca_list = reallocarray(NULL, num_of_alias_max, sizeof(SSL_CIPHER *));
if (ca_list == NULL) {
free(co_list);
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE);
#ifdef KSSL_DEBUG
printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers);
#endif /* KSSL_DEBUG */
- co_list = mallocarray(num_of_ciphers, sizeof(CIPHER_ORDER));
+ co_list = reallocarray(NULL, num_of_ciphers, sizeof(CIPHER_ORDER));
if (co_list == NULL) {
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE);
return(NULL); /* Failure */
*/
num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER);
num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
- ca_list = mallocarray(num_of_alias_max, sizeof(SSL_CIPHER *));
+ ca_list = reallocarray(NULL, num_of_alias_max, sizeof(SSL_CIPHER *));
if (ca_list == NULL) {
free(co_list);
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE);