[Libreoffice-commits] core.git: sc/source
Julien Nabet
serval2412 at yahoo.fr
Fri Aug 16 02:17:01 PDT 2013
sc/source/core/opencl/formulagroupcl.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 35223e5f19dc1f4e59c3694e98103444c82082b8
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Thu Aug 15 22:40:40 2013 +0200
cppcheck: memory leak + test rResult before freeing it
Change-Id: Ia2cd69eb0a180cdfb747a82edefbe1527138b26d
Reviewed-on: https://gerrit.libreoffice.org/5444
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 915f1d9..274af4e 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -313,7 +313,10 @@ bool FormulaGroupInterpreterOpenCL::interpret(ScDocument& rDoc, const ScAddress&
ScFormulaCell* pDest = rDoc.GetFormulaCell(aTmpPos);
if (!pDest)
+ {
+ free(rResult);
return false;
+ }
if(ocl_calc.GetOpenclState())
{
const formula::FormulaToken *pCur = aCode2.First();
@@ -473,8 +476,7 @@ bool FormulaGroupInterpreterOpenCL::interpret(ScDocument& rDoc, const ScAddress&
rDoc.SetFormulaResults(rTopPos, rResult, xGroup->mnLength);
}
- if(rResult)
- free(rResult);
+ free(rResult);
return true;
}
More information about the Libreoffice-commits
mailing list