diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-02-07 20:50:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-07 20:50:48 +0000 |
commit | 6377907addf266d783ba741a7d4f425f86fb7b20 (patch) | |
tree | 1922617f57d12bcc7b7349dc973a05071ce5c598 /vcl | |
parent | 4fe6abdf69488dd52806085f812b69317b0d2d49 (diff) |
coverity#705773 Resource leak
Change-Id: I630fc03502b7bc510313656ae11ae1159f2319ae
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/generic/dtrans/X11_selection.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index c3b878df4b37..ead695ce4d97 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -1194,12 +1194,15 @@ bool SelectionManager::getPasteData( Atom selection, const OUString& rType, Sequ sal_Int32 nOutSize = 0; sal_uInt8* pBytes = X11_getBmpFromPixmap( m_pDisplay, aPixmap, aColormap, nOutSize ); - if( pBytes && nOutSize ) + if( pBytes ) { - rData = Sequence< sal_Int8 >( nOutSize ); - memcpy( rData.getArray(), pBytes, nOutSize ); + if( nOutSize ) + { + rData = Sequence< sal_Int8 >( nOutSize ); + memcpy( rData.getArray(), pBytes, nOutSize ); + bSuccess = true; + } X11_freeBmp( pBytes ); - bSuccess = true; } } } |