eolian: properly handle errors in database_fill

Fixes CID 1299294.

@fix
This commit is contained in:
Daniel Kolesa 2015-05-20 18:11:02 +01:00
parent 54974b074b
commit 370f406d2f
1 changed files with 3 additions and 7 deletions

View File

@ -224,25 +224,21 @@ eo_parser_database_fill(const char *filename, Eina_Bool eot)
if (!ls)
{
fprintf(stderr, "eolian: unable to create lexer for file '%s'\n", filename);
return EINA_FALSE;
goto error;
}
/* read first token */
eo_lexer_get(ls);
if (!eo_parser_walk(ls, eot))
{
eo_lexer_free(ls);
return EINA_FALSE;
}
goto error;
if (eot) goto done;
if (!eina_list_count(ls->tmp.classes))
{
fprintf(stderr, "eolian: no classes for file '%s'\n", filename);
eo_lexer_free(ls);
return EINA_FALSE;
goto error;
}
while (ls->tmp.classes)