diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-17 20:43:09 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-18 11:43:26 +0200 |
commit | 1ebc9435849430c61bf41e48a84255a17152fbc9 (patch) | |
tree | ec8c573c593dec7b1a76eeff9fd7f4f4a8e58d94 /sd/source/ui/view/sdview3.cxx | |
parent | e5e509551c229f242b3111d43887b22717846ccf (diff) |
cid#1448534 Use after free
Change-Id: Ibef20405d1ecf00b71ca12e43902ccd65c873ed2
Reviewed-on: https://gerrit.libreoffice.org/75815
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source/ui/view/sdview3.cxx')
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 98167637628d..a5ef90d7f7c6 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -1175,14 +1175,16 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, nOptions |= SdrInsertFlags::DONTMARK; } - InsertObjectAtView( pObj, *pPV, nOptions ); + bReturn = InsertObjectAtView( pObj, *pPV, nOptions ); - if( pImageMap ) - pObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new SdIMapInfo( *pImageMap )) ); + if (bReturn) + { + if( pImageMap ) + pObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new SdIMapInfo( *pImageMap )) ); - // let the object stay in loaded state after insertion - pObj->Unload(); - bReturn = true; + // let the object stay in loaded state after insertion + pObj->Unload(); + } } } } |