summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-12-15 09:50:05 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-12-15 18:39:42 +0100
commitdeba726824b751cdba7b13793e68ecc442168e7d (patch)
treed43a63e00d376dd3fb96c5f74f0d22f31b0f71e1 /starmath
parent2392077d47f2ccf0851391b0d0bba0a268d1014a (diff)
ofz#4643 Direct-leak
Change-Id: Ie4fff1a113916c7a3344959cfb4ee14c3fda2073 Reviewed-on: https://gerrit.libreoffice.org/46512 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/parse.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 57344e1c6ffe..9cc4feee9e7a 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1340,7 +1340,8 @@ SmNode *SmParser::DoTerm(bool bGroupNumberIdent)
return pNode.release();
}
auto pSNode = o3tl::make_unique<SmExpressionNode>(m_aCurToken);
- pSNode->SetSubNodes(pNode.release(), DoError(SmParseError::RgroupExpected));
+ std::unique_ptr<SmNode> xError(DoError(SmParseError::RgroupExpected));
+ pSNode->SetSubNodes(pNode.release(), xError.release());
return pSNode.release();
}
@@ -1566,16 +1567,15 @@ SmOperNode *SmParser::DoOperator()
auto pSNode = o3tl::make_unique<SmOperNode>(m_aCurToken);
// get operator
- SmNode *pOperator = DoOper();
+ std::unique_ptr<SmNode> xOperator(DoOper());
- if ( m_aCurToken.nGroup == TG::Limit ||
- m_aCurToken.nGroup == TG::Power )
- pOperator = DoSubSup(m_aCurToken.nGroup, pOperator);
+ if (m_aCurToken.nGroup == TG::Limit || m_aCurToken.nGroup == TG::Power)
+ xOperator.reset(DoSubSup(m_aCurToken.nGroup, xOperator.release()));
// get argument
- SmNode *pArg = DoPower();
+ std::unique_ptr<SmNode> xArg(DoPower());
- pSNode->SetSubNodes(pOperator, pArg);
+ pSNode->SetSubNodes(xOperator.release(), xArg.release());
return pSNode.release();
}