From 925d1dd32fe4973b18c95d6e61c13134dd88ff72 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Tue, 3 May 2016 16:59:06 +0200 Subject: [PATCH] xmlrpc: user libxml function to get content of node if type not provided for param - it is considered to be string according to specs - old implementation was using the pointer inside the xmlNode struct, which may not be available later to free again by xmlrpc module garbage collector - reported by Juha Heinanen (cherry picked from commit 6b23c27d8406780083a6b7bb774efa2a53aea540) (cherry picked from commit 45060ef72edf5fdac9376150e60d56ff9458e4ff) --- modules/xmlrpc/xmlrpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/xmlrpc/xmlrpc.c b/modules/xmlrpc/xmlrpc.c index 7ba2e90a678..d4b89a7e381 100644 --- a/modules/xmlrpc/xmlrpc.c +++ b/modules/xmlrpc/xmlrpc.c @@ -1405,6 +1405,7 @@ static int get_string(char** val, struct xmlrpc_reply* reply, return -1; } type=xml_get_type(dbl); + LM_DBG("xmrpc parameter type: %d\n", type); switch(type){ case XML_T_STR: case XML_T_TXT: @@ -1421,7 +1422,7 @@ static int get_string(char** val, struct xmlrpc_reply* reply, return -1; } if (type == XML_T_TXT) - val_str = (char*)dbl->content; + val_str = (char*)xmlNodeGetContent(dbl); else val_str = (char*)xmlNodeListGetString(doc, dbl->xmlChildrenNode, 1);