summaryrefslogtreecommitdiffstats
path: root/libvncclient/vncviewer.c
diff options
context:
space:
mode:
authordscho <dscho>2004-12-01 18:21:39 +0000
committerdscho <dscho>2004-12-01 18:21:39 +0000
commit7d3b1c9762b5f2878e9783677677cb2b3aa10e7e (patch)
treecf6a503d0d89006e39de5f5c4393b89ba1d2c8e4 /libvncclient/vncviewer.c
parentc641923d058c1f8927bb3169c5f78b0510adb72f (diff)
downloadlibtdevnc-7d3b1c9762b5f2878e9783677677cb2b3aa10e7e.tar.gz
libtdevnc-7d3b1c9762b5f2878e9783677677cb2b3aa10e7e.zip
use rfbClientErr to log errors, check if calloc succeded (both hinted by Andre Leiradella)
Diffstat (limited to 'libvncclient/vncviewer.c')
-rw-r--r--libvncclient/vncviewer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c
index 914b422..2a11970 100644
--- a/libvncclient/vncviewer.c
+++ b/libvncclient/vncviewer.c
@@ -91,6 +91,10 @@ static void initAppData(AppData* data) {
rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
int bytesPerPixel) {
rfbClient* client=(rfbClient*)calloc(sizeof(rfbClient),1);
+ if(!client) {
+ rfbClientErr("Couldn't allocate client structure!\n");
+ return 0;
+ }
initAppData(&client->appData);
client->programName = 0;
client->endianTest = 1;