X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=main.c;h=455c049cbb6a5678e286b4d605cd6c4cc810b9ef;hp=17d71d19ea331c0d26279baa7348ac709289782e;hb=a9c694d5b6ea026a0c745e5b650993bf0f1c13dc;hpb=7cb94b9e3f669a62272d07747d346f5393d71c1d diff --git a/main.c b/main.c index 17d71d1..455c049 100644 --- a/main.c +++ b/main.c @@ -45,12 +45,10 @@ build_state(bool runtime) struct uci_package *p = NULL; FILE *sf; - state = malloc(sizeof(*state)); - + state = calloc(1, sizeof(*state)); if (!state) error("Out of memory"); - memset(state, 0, sizeof(*state)); state->uci = uci_alloc_context(); if (!state->uci)