From 913ff7df2c13517282e3de85fc717e44f88f72d0 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Tue, 1 Mar 2016 20:21:32 +0100 Subject: [PATCH 29/37] coverity: avoid possible null ptr deref --- src/libcmis/ws-object.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcmis/ws-object.cxx b/src/libcmis/ws-object.cxx index b771aed..0eee69f 100644 --- a/src/libcmis/ws-object.cxx +++ b/src/libcmis/ws-object.cxx @@ -87,13 +87,13 @@ libcmis::ObjectPtr WSObject::updateProperties( libcmis::ObjectPtr object; if ( getBaseType( ) == "cmis:document" ) { - WSDocument* thisDoc = dynamic_cast< WSDocument* >( this ); - object.reset( new WSDocument( *thisDoc ) ); + const WSDocument& thisDoc = dynamic_cast< const WSDocument& >( *this ); + object.reset( new WSDocument( thisDoc ) ); } else if ( getBaseType( ) == "cmis:folder" ) { - WSFolder* thisFolder = dynamic_cast< WSFolder* >( this ); - object.reset( new WSFolder( *thisFolder ) ); + const WSFolder& thisFolder = dynamic_cast< const WSFolder& >( *this ); + object.reset( new WSFolder( thisFolder ) ); } return object; } -- 2.5.0