X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=file.c;h=d320ba6c3cd66d49bd708d0756826c80511f3548;hp=883e36006e39b84390906943af13ac69365e49f0;hb=4e55f6b3829420be74d35db2e55bafb18ac8ce21;hpb=c90d9cb8ba073d1c98e61591303aa96300750940 diff --git a/file.c b/file.c index 883e360..d320ba6 100644 --- a/file.c +++ b/file.c @@ -69,7 +69,7 @@ static void uci_switch_config(struct uci_context *ctx) * if an older config under the same name exists, unload it * ignore errors here, e.g. if the config was not found */ - e = uci_lookup_list(ctx, &ctx->root, name); + e = uci_lookup_list(&ctx->root, name); if (e) UCI_THROW(ctx, UCI_ERR_DUPLICATE); pctx->package = uci_alloc_package(ctx, name); @@ -122,7 +122,8 @@ static void uci_parse_config(struct uci_context *ctx, char **str) if (pctx->merge) { UCI_TRAP_SAVE(ctx, error); - uci_set(ctx, pctx->package, name, NULL, type, NULL); + if (uci_set(ctx, pctx->package, name, NULL, type, NULL) != UCI_OK) + goto error; UCI_TRAP_RESTORE(ctx); return; error: