tdf#163486: PVS: redundant nullptr check

V668 	There is no sense in testing the 'm_pRelStorElement->m_xStorage' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error.

Change-Id: Ie195de78b48c3766ef08a2d3666f778f75d2ca6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176596
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli 2024-11-14 13:28:13 +01:00
parent 19e1cf2d1c
commit 45bb8d9ddc

View file

@ -1582,8 +1582,7 @@ void OStorage_Impl::CreateRelStorage()
{
m_pRelStorElement = new SotElement_Impl( u"_rels"_ustr, true, true );
m_pRelStorElement->m_xStorage = CreateNewStorageImpl(embed::ElementModes::WRITE);
if (m_pRelStorElement->m_xStorage)
m_pRelStorElement->m_xStorage->m_pParent = nullptr; // the relation storage is completely controlled by parent
m_pRelStorElement->m_xStorage->m_pParent = nullptr; // the relation storage is completely controlled by parent
}
if (!m_pRelStorElement->m_xStorage)