summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-07 20:50:48 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-07 20:50:48 +0000
commit6377907addf266d783ba741a7d4f425f86fb7b20 (patch)
tree1922617f57d12bcc7b7349dc973a05071ce5c598 /vcl/unx
parent4fe6abdf69488dd52806085f812b69317b0d2d49 (diff)
coverity#705773 Resource leak
Change-Id: I630fc03502b7bc510313656ae11ae1159f2319ae
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/dtrans/X11_selection.cxx11
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;
}
}
}