From e18d3fb3e64bf310040848a7202d4f89a989581b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 8 May 2013 23:21:15 +0200 Subject: [PATCH] Fix regression for mergekey creation Due to xmlNodeListGetString returning null on some platforms and empty "" on others (probably depends on Libxml2 version). --- src/session.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/session.c b/src/session.c index 400dd04..bb1f6cb 100644 --- a/src/session.c +++ b/src/session.c @@ -1502,7 +1502,7 @@ static int get_mergekey_from_doc(xmlDoc *doc, xmlNode *root, const char *name, else if (!strcmp(name, (const char *) type)) { xmlChar *value = xmlNodeListGetString(doc, n->children, 1); - if (value) + if (value && *value) { const char *norm_str; pp2_charset_token_t prt = @@ -1521,10 +1521,11 @@ static int get_mergekey_from_doc(xmlDoc *doc, xmlNode *root, const char *name, wrbuf_puts(norm_wr, norm_str); } } - xmlFree(value); pp2_charset_token_destroy(prt); no_found++; } + if (value) + xmlFree(value); } xmlFree(type); } -- 1.7.10.4