Kaydet (Commit) 3eb77853 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix memory leak

...and add---most likely necessary---null check

Change-Id: I3f31c20442c45ddfd98429347f5c2521597c1769
üst bf2e8fad
......@@ -174,13 +174,18 @@ xmlNodePtr HelpCompiler::clone(xmlNodePtr node, const std::string& appl)
if (strcmp((const char*)list->name, "switchinline") == 0 || strcmp((const char*)list->name, "switch") == 0)
{
std::string tmp="";
if (strcmp((const char*)xmlGetProp(list, (xmlChar*)"select"), "sys"))
xmlChar * prop = xmlGetProp(list, (xmlChar*)"select");
if (prop != 0)
{
tmp = gui;
}
if (strcmp((const char*)xmlGetProp(list, (xmlChar*)"select"), "appl"))
{
tmp = appl;
if (strcmp((char *)prop, "sys") == 0)
{
tmp = gui;
}
else if (strcmp((char *)prop, "appl") == 0)
{
tmp = appl;
}
xmlFree(prop);
}
if (tmp.compare("") != 0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment