From 088446e97dd838ce4c2c07656f26cbf672cf6f42 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 28 Apr 2008 17:00:26 +0200 Subject: [PATCH] [client] Free markup data Signed-off-by: Julien Danjou --- client.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client.c b/client.c index 0f83ea15..35edd7f6 100644 --- a/client.c +++ b/client.c @@ -820,13 +820,21 @@ client_markup_parse(client_t *c, const char *str, ssize_t len) const char *elements[] = { "title", NULL }; const char *elements_sub[] = { c->name , NULL }; markup_parser_data_t *p; + char *ret; p = markup_parser_data_new(elements, elements_sub, countof(elements)); - if(!markup_parse(p, str, len)) + if(markup_parse(p, str, len)) + { + ret = p->text; + p->text = NULL; + } + else return a_strdup(str); - return p->text; + markup_parser_data_delete(&p); + + return ret; } /** Set the transparency of the selected client.