diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-08 20:55:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-08 21:22:22 +0100 |
commit | daef8b82d00bbe823f711f73895ef422376a2f95 (patch) | |
tree | fa0ccb88f042884f06415467cf905a809df270b4 | |
parent | c8ef7a4fbeb15e774f30c2e800247c7fc283cb0e (diff) |
CID#1038507 calm coverity nerves about a double free
Change-Id: Idc1c8e93ecdf7b2992bf08d54f2f63d337bea7eb
-rw-r--r-- | sc/source/core/data/documen4.cxx | 7 |
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, |