free xpath object

This commit is contained in:
fpeters 2005-01-27 23:02:37 +00:00
parent b60fd300c4
commit 444e33493f
1 changed files with 5 additions and 1 deletions

View File

@ -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()