free xpath object
This commit is contained in:
parent
b60fd300c4
commit
444e33493f
|
@ -52,14 +52,18 @@ int init_config()
|
|||
char* get_config_string(char *xpath)
|
||||
{
|
||||
xmlXPathObjectPtr xpathObj;
|
||||
char *content;
|
||||
|
||||
xpathObj = xmlXPathEval(xpath, xpathCtx);
|
||||
if (xpathObj == NULL || xpathObj->nodesetval == NULL || \
|
||||
xpathObj->nodesetval->nodeNr == 0) {
|
||||
if (xpathObj) xmlXPathFreeObject(xpathObj);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return xpathObj->nodesetval->nodeTab[0]->children->content;
|
||||
content = xpathObj->nodesetval->nodeTab[0]->children->content;
|
||||
xmlXPathFreeObject(xpathObj);
|
||||
return content;
|
||||
}
|
||||
|
||||
LassoServer* get_config_server()
|
||||
|
|
Reference in New Issue