Parser: Fix fetch_section_first when the section doesn't exist
This commit is contained in:
parent
5875af2949
commit
3811d61858
@ -561,6 +561,7 @@ conf_menu_section(void)
|
||||
struct conf_sec *menu, **set_menu, **item;
|
||||
|
||||
menu = fetch_section_first(NULL, "menu");
|
||||
|
||||
set_menu = fetch_section(menu, "set_menu");
|
||||
|
||||
CHECK((conf.nmenu = fetch_section_count(set_menu)));
|
||||
|
||||
@ -503,6 +503,9 @@ fetch_section_first(struct conf_sec *s, char *name)
|
||||
if (!strcmp(sec->name, name))
|
||||
return sec;
|
||||
|
||||
if(!sec)
|
||||
return NULL;
|
||||
|
||||
TAILQ_FOREACH(sec, &s->sub, entry)
|
||||
if (!strcmp(sec->name, name))
|
||||
return sec;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user