Possibly cleaner/simpler would be to replace

    IPropertyTree* servicecfg = cfg->getPropTree(xpath.str());
    m_servicecfg.setown(servicecfg);

with

    m_servicecfg.setown(cfg->getPropTree(xpath.str()));