summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-08 20:55:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-08 21:22:22 +0100
commitdaef8b82d00bbe823f711f73895ef422376a2f95 (patch)
treefa0ccb88f042884f06415467cf905a809df270b4 /sc
parentc8ef7a4fbeb15e774f30c2e800247c7fc283cb0e (diff)
CID#1038507 calm coverity nerves about a double free
Change-Id: Idc1c8e93ecdf7b2992bf08d54f2f63d337bea7eb
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen4.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 608cf4d0dd48..53c90db8494d 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -284,7 +284,12 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
continue;
if (*itr == nTab1)
- maTabs[*itr]->SetFormulaCell(nCol1, nRow1, pCell);
+ {
+ pCell = maTabs[*itr]->SetFormulaCell(nCol1, nRow1, pCell);
+ assert(pCell); //NULL if nCol1/nRow1 is invalid, which it can't be here
+ if (!pCell)
+ break;
+ }
else
maTabs[*itr]->SetFormulaCell(
nCol1, nRow1,