]> source.dussan.org Git - tigervnc.git/commitdiff
Check the return value from XShmAttach. 48/head
authorTim Waugh <twaugh@redhat.com>
Fri, 17 Oct 2014 09:28:55 +0000 (10:28 +0100)
committerTim Waugh <twaugh@redhat.com>
Fri, 17 Oct 2014 09:28:55 +0000 (10:28 +0100)
vncviewer/X11PixelBuffer.cxx

index f83aa5f4a6137dbd1813695299474f4f6b6f441f..a7794277b70af85b1728cb3d1893846d1eba1a65 100644 (file)
@@ -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);