ti = ti->next;
}
if (!ti) {
- ti = malloc(sizeof(struct uci_type_list));
+ ti = calloc(1, sizeof(struct uci_type_list));
if (!ti)
return NULL;
- memset(ti, 0, sizeof(struct uci_type_list));
ti->next = type_list;
type_list = ti;
ti->name = s->type;
{
struct uci_context *ctx;
- ctx = (struct uci_context *) malloc(sizeof(struct uci_context));
+ ctx = (struct uci_context *) calloc(1, sizeof(struct uci_context));
if (!ctx)
return NULL;
- memset(ctx, 0, sizeof(struct uci_context));
uci_list_init(&ctx->root);
uci_list_init(&ctx->delta_path);
uci_list_init(&ctx->backends);
size = sizeof(struct ucimap_list) +
n_elements * sizeof(union ucimap_data);
- data->list = malloc(size);
+ data->list = calloc(1, size);
if (!data->list)
goto error_mem;
- memset(data->list, 0, size);
data->list->size = n_elements;
} else {
ucimap_count_alloc(om, &n_alloc, &n_alloc_custom);
continue;
memset(sd, 0, sizeof(struct ucimap_section_data));
} else {
- sd = malloc(sm->alloc_len);
+ sd = calloc(1, sm->alloc_len);
if (!sd)
continue;
- memset(sd, 0, sm->alloc_len);
sd = ucimap_ptr_section(sm, sd);
}