]> git.ozlabs.org Git - petitboot/blobdiff - discover/yaboot-parser.c
Various fixups and checks to make scan-build happy
[petitboot] / discover / yaboot-parser.c
index 42db95bcfbbb1ae758b4704303baa3b3992dc5d8..d0a40b1b4fd14d16e628751b78db1e12c85b9598 100644 (file)
@@ -172,6 +172,7 @@ static void yaboot_finish(struct conf_context *conf)
                state->opt->option->is_default = true;
 
        discover_context_add_boot_option(conf->dc, state->opt);
+       state->opt = NULL;
 }
 
 static void yaboot_process_pair(struct conf_context *conf, const char *name,
@@ -212,6 +213,8 @@ static void yaboot_process_pair(struct conf_context *conf, const char *name,
 
                /* Then start the new image. */
                opt = state_start_new_option(conf, state);
+               if (!opt)
+                       pb_debug_fn("new opt is NULL\n");
 
                state->boot_image = talloc_strdup(state, value);
 
@@ -234,6 +237,8 @@ static void yaboot_process_pair(struct conf_context *conf, const char *name,
 
                /* Then start the new image. */
                opt = state_start_new_option(conf, state);
+               if (!opt)
+                       pb_debug_fn("new opt is NULL\n");
 
                if (*value == '/') {
                        state->boot_image = talloc_strdup(state, value);