summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-08-20 10:55:27 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-08-20 14:33:26 +0200
commit77d8199f59b85f961088d8aec00d9d582b0df873 (patch)
tree49204dca698c5103c363f8322b9b4fd5263345a5
parentb38b04702090504134d4433e36001079c1b027ae (diff)
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 <caolanm@redhat.com>
-rw-r--r--sw/source/core/doc/DocumentFieldsManager.cxx5
1 files changed, 4 insertions, 1 deletions
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();