Module: kamailio Branch: 4.4 Commit: ea20338f8786fac2bb290a610f938fec8e7ece54 URL: https://github.com/kamailio/kamailio/commit/ea20338f8786fac2bb290a610f938fec...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Juha Heinanen jh@tutpro.com Date: 2016-05-03T18:33:10+03:00
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)
---
Modified: modules/xmlrpc/xmlrpc.c
---
Diff: https://github.com/kamailio/kamailio/commit/ea20338f8786fac2bb290a610f938fec... Patch: https://github.com/kamailio/kamailio/commit/ea20338f8786fac2bb290a610f938fec...
---
diff --git a/modules/xmlrpc/xmlrpc.c b/modules/xmlrpc/xmlrpc.c index 8761c02..dabb526 100644 --- a/modules/xmlrpc/xmlrpc.c +++ b/modules/xmlrpc/xmlrpc.c @@ -1407,6 +1407,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: @@ -1423,7 +1424,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);