diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-13 21:11:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-13 21:13:47 +0000 |
commit | 8eb8175db8ba33e7bde15011f31de20a84a6e56f (patch) | |
tree | 215234f98d77c95f8a8c94477634cc40716e9334 | |
parent | 64f3c4fe478f0e2478fead92506f592d5401bf33 (diff) |
coverity#1251592 Dereference before null check
Change-Id: Ia69bb21080ab7a42a0b9f9871f72ab696b6098ed
-rw-r--r-- | vcl/unx/generic/gdi/gdiimpl.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx index 4adea6259f46..0088028dfd45 100644 --- a/vcl/unx/generic/gdi/gdiimpl.cxx +++ b/vcl/unx/generic/gdi/gdiimpl.cxx @@ -167,13 +167,10 @@ X11Pixmap* X11SalGraphicsImpl::GetPixmapFromScreen( const Rectangle& rRect ) rRect.GetWidth(), rRect.GetHeight(), 24 ); GC aTmpGC = XCreateGC( pDpy, pPixmap->GetPixmap(), 0, NULL ); - if( !pPixmap || !aTmpGC ) + if (!aTmpGC) { - if ( pPixmap ) - delete pPixmap; - if ( aTmpGC ) - XFreeGC( pDpy, aTmpGC ); - SAL_WARN( "vcl", "Could not get valid pixmap from screen" ); + delete pPixmap; + SAL_WARN( "vcl", "Could not get valid GC from screen" ); return NULL; } |