X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=ucimap.c;h=b4f9518f5b5af5a4d7d294389b650d6576f71a4d;hp=7af7f635af45dca8d19b61f81ac94de47fdee530;hb=471dcf63d6ed4689cfd56f2648e6d1b48f46f14c;hpb=5077cdcee2b3b54e7e87596a98a77bac246bbaae diff --git a/ucimap.c b/ucimap.c index 7af7f63..b4f9518 100644 --- a/ucimap.c +++ b/ucimap.c @@ -13,7 +13,7 @@ */ /* - * This file contains ucimap, an API for mapping UCI to C data structures + * This file contains ucimap, an API for mapping UCI to C data structures */ #include @@ -314,6 +314,7 @@ ucimap_add_fixup(struct ucimap_section_data *sd, union ucimap_data *data, struct struct ucimap_fixup *f, tmp; struct uci_map *map = sd->map; + tmp.next = NULL; tmp.sm = om->data.sm; tmp.name = str; tmp.type = om->type; @@ -712,10 +713,8 @@ ucimap_parse_section(struct uci_map *map, struct uci_sectionmap *sm, struct ucim return 0; error_mem: - if (sd->alloc_custom) - free(sd->alloc_custom); - if (sd->allocmap) - free(sd->allocmap); + free(sd->alloc_custom); + free(sd->allocmap); free(sd); return UCI_ERR_MEM;