return -ENOMEM;
}
- new_fields = reallocarray(s->fields,
- s->n_fields + 1,
- sizeof(struct rte_swx_field_params));
+ new_fields = realloc(s->fields,
+ (s->n_fields + 1) * sizeof(struct rte_swx_field_params));
if (!new_fields) {
free(name);
return -ENOMEM;
}
- new_instructions = reallocarray(s->instructions,
- s->n_instructions + 1,
- sizeof(char *));
+ new_instructions = realloc(s->instructions,
+ (s->n_instructions + 1) * sizeof(char *));
if (!new_instructions) {
free(instr);
return -ENOMEM;
}
- new_fields = reallocarray(s->params.fields,
- s->params.n_fields + 1,
- sizeof(struct rte_swx_match_field_params));
+ new_fields = realloc(s->params.fields,
+ (s->params.n_fields + 1) * sizeof(struct rte_swx_match_field_params));
if (!new_fields) {
free(name);
return -ENOMEM;
}
- new_action_names = reallocarray(s->params.action_names,
- s->params.n_actions + 1,
- sizeof(char *));
+ new_action_names = realloc(s->params.action_names,
+ (s->params.n_actions + 1) * sizeof(char *));
if (!new_action_names) {
free(name);
return -ENOMEM;
}
- new_instructions = reallocarray(s->instructions,
- s->n_instructions + 1,
- sizeof(char *));
+ new_instructions = realloc(s->instructions,
+ (s->n_instructions + 1) * sizeof(char *));
if (!new_instructions) {
free(instr);