diff options
author | Tim Waugh <twaugh@redhat.com> | 2014-10-17 10:28:55 +0100 |
---|---|---|
committer | Tim Waugh <twaugh@redhat.com> | 2014-10-17 10:28:55 +0100 |
commit | 7c56b4c332c2bfadc851375b0d38b6991ea81a7a (patch) | |
tree | eedff1511f164470543799383852595bed3f7ea9 /vncviewer | |
parent | b17c9c4dedf09873b10b3c23d5f189aa9eba6978 (diff) | |
download | tigervnc-7c56b4c332c2bfadc851375b0d38b6991ea81a7a.tar.gz tigervnc-7c56b4c332c2bfadc851375b0d38b6991ea81a7a.zip |
Check the return value from XShmAttach.
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/X11PixelBuffer.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vncviewer/X11PixelBuffer.cxx b/vncviewer/X11PixelBuffer.cxx index f83aa5f4..a7794277 100644 --- a/vncviewer/X11PixelBuffer.cxx +++ b/vncviewer/X11PixelBuffer.cxx @@ -189,7 +189,11 @@ int X11PixelBuffer::setupShm() caughtError = false; old_handler = XSetErrorHandler(XShmAttachErrorHandler); - XShmAttach(fl_display, shminfo); + if (!XShmAttach(fl_display, shminfo)) { + XSetErrorHandler(old_handler); + goto free_shmaddr; + } + XSync(fl_display, False); XSetErrorHandler(old_handler); |