sw/source/core/doc/DocumentFieldsManager.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
New commits: commit 77d8199f59b85f961088d8aec00d9d582b0df873 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Aug 20 10:55:27 2022 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Aug 20 14:33:26 2022 +0200 cid#1500683 silence Resource leak Change-Id: Ib4a469ea5e5392dc5144dcf4ff0c8994bd8847be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138578 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index 23c7125c1b80..448d821b54df 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -379,7 +379,10 @@ void DocumentFieldsManager::RemoveFieldType(size_t nField) OSL_ENSURE( !pTmp->HasWriterListeners(), "Dependent fields present!" ); } else - (*mpFieldTypes)[nField].release(); // DB fields are ref-counted and delete themselves + { + // coverity[leaked_storage] - at this point DB fields are ref-counted and delete themselves + (*mpFieldTypes)[nField].release(); + } mpFieldTypes->erase( mpFieldTypes->begin() + nField ); m_rDoc.getIDocumentState().SetModified();
