basic/source/sbx/sbxdec.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
New commits: commit be596c0192f059324d06716b625be6a11079f8ea Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Dec 22 14:51:39 2021 +0100 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Dec 23 10:34:19 2021 +0100 Nullify passed pointer in releaseDecimalPtr unconditionally This was an implementation error ever since it was introduced in commit 79d3bc479950127ecfd40f73978c0fc84c1e7908. The function is used to release the refcounted object, and the calling code does not always set the pointer to another value or discard it (see uses in basic/source/sbx/sbxvalue.cxx). If it resets the pointer in some cases, it must do it always. Change-Id: I17de412914935082d20f2a1a91ea6e4e289936aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127254 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx index e47713445cf7..acfc31acfbd0 100644 --- a/basic/source/sbx/sbxdec.cxx +++ b/basic/source/sbx/sbxdec.cxx @@ -80,10 +80,8 @@ void releaseDecimalPtr( SbxDecimal*& rpDecimal ) { rpDecimal->mnRefCount--; if( rpDecimal->mnRefCount == 0 ) - { delete rpDecimal; - rpDecimal = nullptr; - } + rpDecimal = nullptr; } }