diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2013-08-15 22:40:40 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-08-16 09:16:38 +0000 |
commit | 35223e5f19dc1f4e59c3694e98103444c82082b8 (patch) | |
tree | 1bd14210d6f03865f57bb787742498e05589ed91 /sc/source | |
parent | 27e7da167052900214e61e6792da93e3ba1310f5 (diff) |
cppcheck: memory leak + test rResult before freeing it
Change-Id: Ia2cd69eb0a180cdfb747a82edefbe1527138b26d
Reviewed-on: https://gerrit.libreoffice.org/5444
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 915f1d930187..274af4e442c8 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; } |