[draw] Handle error on end of feeding into XML parser

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-27 09:18:09 +02:00
parent a3b1b3be0b
commit 5447001254
1 changed files with 2 additions and 3 deletions

View File

@ -288,15 +288,14 @@ draw_text_markup_expand(draw_parser_data_t *data,
mkp_ctx = g_markup_parse_context_new(&parser, 0, data, NULL); mkp_ctx = g_markup_parse_context_new(&parser, 0, data, NULL);
if(!g_markup_parse_context_parse(mkp_ctx, text, len - 1, &error)) if(!g_markup_parse_context_parse(mkp_ctx, text, len - 1, &error)
|| !g_markup_parse_context_end_parse(mkp_ctx, &error))
{ {
warn("unable to parse text: %s\n", error->message); warn("unable to parse text: %s\n", error->message);
g_error_free(error); g_error_free(error);
return false; return false;
} }
g_markup_parse_context_end_parse(mkp_ctx, &error);
g_markup_parse_context_free(mkp_ctx); g_markup_parse_context_free(mkp_ctx);
p_delete(&text); p_delete(&text);