X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=libuci.c;h=a1fd92a1277713da3449bfb65e2bb84b1fdc57cc;hb=7b75c2af80f2ea8a73f4718223011ad778904faf;hp=a3dde2edc4adedd320577cc138a26472c586bcb2;hpb=f85abaa9f87af0d3ab54c33f3ef1a98784d84e83;p=uci.git diff --git a/libuci.c b/libuci.c index a3dde2e..a1fd92a 100644 --- a/libuci.c +++ b/libuci.c @@ -55,6 +55,9 @@ struct uci_context *uci_alloc_context(void) struct uci_context *ctx; ctx = (struct uci_context *) malloc(sizeof(struct uci_context)); + if (!ctx) + return NULL; + memset(ctx, 0, sizeof(struct uci_context)); uci_list_init(&ctx->root); uci_list_init(&ctx->history_path);