[Libreoffice-commits] .: idlc/source

David Tardon dtardon at kemper.freedesktop.org
Tue May 17 21:08:54 PDT 2011


 idlc/source/astexpression.cxx |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 2f4dbee15a4675c79344b9718d0c149f3f652d24
Author: David Tardon <dtardon at redhat.com>
Date:   Tue May 17 08:37:11 2011 +0200

    do not leak memory

diff --git a/idlc/source/astexpression.cxx b/idlc/source/astexpression.cxx
index 79f6c62..87f52c1 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;
-    }
-    
-    return coerce_value(copy, t);
+        m_exprValue = coerced;
+
+    return coerced;
 }
 
 void AstExpression::evaluate(EvalKind ek)


More information about the Libreoffice-commits mailing list