summaryrefslogtreecommitdiff
path: root/idlc
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-05-17 08:37:11 +0200
committerDavid Tardon <dtardon@redhat.com>2011-05-17 15:19:41 +0200
commit307313e182185fd49a85eabdb7b0732da077d6b0 (patch)
tree999f20e30bd1df6df87431f72fe5bca4ec9de54d /idlc
parent474d8ffd63bbad835f1d5ccb73fcb82c2849db0f (diff)
do not leak memory
Diffstat (limited to 'idlc')
-rw-r--r--idlc/source/astexpression.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/idlc/source/astexpression.cxx b/idlc/source/astexpression.cxx
index b3cf5f2a51cc..7b5a0ca390c4 100644
--- a/idlc/source/astexpression.cxx
+++ b/idlc/source/astexpression.cxx
@@ -785,13 +785,14 @@ AstExprValue* AstExpression::coerce(ExprType t, sal_Bool bAssign)
break;
}
+ AstExprValue* const coerced(coerce_value(copy, t));
+ if (!coerced)
+ delete copy;
+
if (bAssign)
- {
- m_exprValue = coerce_value(copy, t);
- return m_exprValue;
- }
+ m_exprValue = coerced;
- return coerce_value(copy, t);
+ return coerced;
}
void AstExpression::evaluate(EvalKind ek)