X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=list.c;h=6e03f18bdec9d4a4396064a6edfd1a67905887cd;hp=339ad3e336385b95246aed8dcddbeac92616a42a;hb=51b60a322aff3fd1045fb6c9eb289ade2de54e71;hpb=7cefa00eadb4292d2c915a38a86e588c6e539d26 diff --git a/list.c b/list.c index 339ad3e..6e03f18 100644 --- a/list.c +++ b/list.c @@ -74,7 +74,7 @@ uci_alloc_generic(struct uci_context *ctx, int type, const char *name, int size) error: free(ptr); - UCI_THROW(ctx, ctx->errno); + UCI_THROW(ctx, ctx->err); done: return e; @@ -236,7 +236,7 @@ int uci_lookup(struct uci_context *ctx, struct uci_element **res, struct uci_pac UCI_HANDLE_ERR(ctx); UCI_ASSERT(ctx, res != NULL); UCI_ASSERT(ctx, p != NULL); - UCI_ASSERT(ctx, uci_validate_name(section)); + UCI_ASSERT(ctx, section && uci_validate_name(section)); if (option) UCI_ASSERT(ctx, uci_validate_name(option));