I was seeing list corruption and segfaults in pb-discover on my Talos
II when using both yaboot and kboot config files on the same device.
My assumption is that discover_context_add_boot_option() was being
called on the same pointer more than once.
So, null the pointer right after the call. The ownership was transferred
anyway so the parsers should not keep it around.
Signed-off-by: Brandon Bergren <git@bdragon.rtk0.net>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
if (info->proxy)
info->opt->proxy = talloc_strdup(info->opt, info->proxy);
discover_context_add_boot_option(conf->dc, info->opt);
+ info->opt = NULL;
}
}
conf_strip_str(opt->description);
discover_context_add_boot_option(dc, d_opt);
+ d_opt = NULL;
continue;
fail:
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,