Replace malloc() + memset() with calloc()
[project/uci.git] / cli.c
diff --git a/cli.c b/cli.c
index 6ba97ea0742494831edf468f6b16ddd33ea2f479..267437d096d227519220380b698a164b216dc94c 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -100,10 +100,9 @@ uci_lookup_section_ref(struct uci_section *s)
                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;