From daef8b82d00bbe823f711f73895ef422376a2f95 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 8 Oct 2013 20:55:53 +0100 Subject: CID#1038507 calm coverity nerves about a double free Change-Id: Idc1c8e93ecdf7b2992bf08d54f2f63d337bea7eb --- sc/source/core/data/documen4.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sc') 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, -- cgit