diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-07-20 15:55:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-07-20 15:55:44 +0200 |
commit | e5a0755bc2f8129cb854367740a02c859555c033 (patch) | |
tree | 2b48b7beb473448187a649ad619f17331bfdc804 /dtrans/source | |
parent | Unnecessary sorted_vector_compare (diff) | |
download | core-e5a0755bc2f8129cb854367740a02c859555c033.tar.gz core-e5a0755bc2f8129cb854367740a02c859555c033.zip |
new does not return null
Change-Id: Iea00f7c6435c6ae3ccbb2f97ab4407df8b86c54b
Diffstat (limited to 'dtrans/source')
-rw-r--r-- | dtrans/source/win32/dtobj/XTDataObject.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/dtrans/source/win32/dtobj/XTDataObject.cxx index ec3d20189685..a28f86635c99 100644 --- a/dtrans/source/win32/dtobj/XTDataObject.cxx +++ b/dtrans/source/win32/dtobj/XTDataObject.cxx @@ -496,10 +496,9 @@ STDMETHODIMP CXTDataObject::EnumFormatEtc( if ( DATADIR_GET == dwDirection ) { *ppenumFormatetc = new CEnumFormatEtc( this, m_FormatEtcContainer ); - if ( NULL != *ppenumFormatetc ) - static_cast< LPUNKNOWN >( *ppenumFormatetc )->AddRef( ); + static_cast< LPUNKNOWN >( *ppenumFormatetc )->AddRef( ); - hr = ( NULL != *ppenumFormatetc ) ? S_OK : E_OUTOFMEMORY; + hr = S_OK; } else hr = E_INVALIDARG; @@ -832,10 +831,9 @@ STDMETHODIMP CEnumFormatEtc::Clone( IEnumFORMATETC** ppenum ) return E_INVALIDARG; *ppenum = new CEnumFormatEtc( m_lpUnkOuter, m_FormatEtcContainer ); - if ( NULL != *ppenum ) - static_cast< LPUNKNOWN >( *ppenum )->AddRef( ); + static_cast< LPUNKNOWN >( *ppenum )->AddRef( ); - return ( NULL != *ppenum ) ? S_OK : E_OUTOFMEMORY; + return S_OK; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |