fix unused variable
[project/uci.git] / list.c
diff --git a/list.c b/list.c
index 339ad3e..6e03f18 100644 (file)
--- 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));