]> pilppa.org Git - uci.git/blobdiff - cli.c
some extra null pointer checks
[uci.git] / cli.c
diff --git a/cli.c b/cli.c
index e14757e5a88cdfc13aadd74d82813715debab8b1..845fc2acee988e0ac285ba6d6e8f900d53549cf3 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -101,6 +101,8 @@ static int package_cmd(int cmd, char *package)
                cli_perror();
                return 1;
        }
+       if (!p)
+               return 0;
        switch(cmd) {
        case CMD_COMMIT:
                if (uci_commit(ctx, &p, false) != UCI_OK)
@@ -212,6 +214,8 @@ static int uci_do_section_cmd(int cmd, int argc, char **argv)
                cli_perror();
                return 1;
        }
+       if (!p)
+               return 0;
 
        switch(cmd) {
        case CMD_GET: