Origin: https://github.com/LibVNC/libvncserver/pull/360/commits/85d00057b5daf71675462c9b175d8cb2d47cd0e1

--- a/vncviewer/zlib.c
+++ b/vncviewer/zlib.c
@@ -55,6 +55,11 @@
     raw_buffer_size = (( rw * rh ) * ( BPP / 8 ));
     raw_buffer = (char*) malloc( raw_buffer_size );
 
+    if (raw_buffer == NULL) {
+
+       return False;
+
+    }
   }
 
   if (!ReadFromRFBServer((char *)&hdr, sz_rfbZlibHeader))
