diff options
author | Eike Rathke <erack@redhat.com> | 2016-04-23 17:22:06 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-04-23 17:28:27 +0200 |
commit | 4f8d72d06883d29bf5c4113f8035fed8c1febae9 (patch) | |
tree | a896c10b1a27023c64b608c1aeedc92c5d612422 /formula | |
parent | 26adceb098134d918f6d57c8687ab057e24adc39 (diff) |
use FormulaToken::DeleteIfZeroRef() instead of Delete() at some places
The array overflow detecting places that unconditionally deleted the
token in case of overflow should do so only if no reference is held,
i.e. the token was allocated with new and passed immediately without
being assigned to a FormulaTokenRef. Just to be on the safe side.
Change-Id: If2ccabec3725ac73fe82c23f51a291246847cfdb
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/core/api/token.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index ac5e33954ff0..28332ed8802c 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -892,7 +892,7 @@ FormulaToken* FormulaTokenArray::ReplaceToken( sal_uInt16 nOffset, FormulaToken* } else { - t->Delete(); + t->DeleteIfZeroRef(); return nullptr; } } @@ -912,7 +912,7 @@ FormulaToken* FormulaTokenArray::Add( FormulaToken* t ) } else { - t->Delete(); + t->DeleteIfZeroRef(); if ( nLen == FORMULA_MAXTOKENS - 1 ) { t = new FormulaByteToken( ocStop ); |