[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [koffice] kcells: Fix a memory leak.
From:       "Dr. Robert Marmorstein" <robert () narnia ! homeunix ! com>
Date:       2011-08-17 7:33:28
Message-ID: 20110817073328.2315CA60A4 () git ! kde ! org
[Download RAW message or body]

Git commit 5b74a4da12f681314107176d13934c8467e6224d by Dr. Robert Marmorstein.
Committed on 17/08/2011 at 09:32.
Pushed by robertm into branch 'master'.

Fix a memory leak.

M  +4    -1    kcells/KCFormula.cpp

http://commits.kde.org/koffice/5b74a4da12f681314107176d13934c8467e6224d

diff --git a/kcells/KCFormula.cpp b/kcells/KCFormula.cpp
index 1f40ccb..311247a 100644
--- a/kcells/KCFormula.cpp
+++ b/kcells/KCFormula.cpp
@@ -1415,8 +1415,11 @@ KCValue KCFormula::evalRecursive(CellIndirection cellIndirections, QHash<KCCell,
             compile(tokens);
     }
 
-    if (!d->valid)
+    if (!d->valid){
+        if (!d->sheet)
+		delete map;
         return KCValue::errorPARSE();
+    }
 
     for (int pc = 0; pc < d->codes.count(); pc++) {
         KCValue ret;   // for the function caller


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic