]> pilppa.com Git - uci.git/commitdiff
ucimap: fix list initialization
authorFelix Fietkau <nbd@openwrt.org>
Sun, 6 Sep 2009 17:07:21 +0000 (19:07 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 6 Sep 2009 17:07:21 +0000 (19:07 +0200)
ucimap.c

index b477264b23dca1b905784bddb8fd6d32de2d9ad0..c7adacd574db14f2919fa71967df262e4ff80af8 100644 (file)
--- a/ucimap.c
+++ b/ucimap.c
@@ -650,8 +650,8 @@ ucimap_parse_section(struct uci_map *map, struct uci_sectionmap *sm, struct ucim
                        if (!data->list)
                                goto error_mem;
 
-                       data->list->size = n_elements;
                        memset(data->list, 0, size);
+                       data->list->size = n_elements;
                } else {
                        ucimap_count_alloc(om, &n_alloc, &n_alloc_custom);
                }