aboutsummaryrefslogtreecommitdiffstats
path: root/unix/vncconfig/vncconfig.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unix/vncconfig/vncconfig.cxx')
-rw-r--r--unix/vncconfig/vncconfig.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/unix/vncconfig/vncconfig.cxx b/unix/vncconfig/vncconfig.cxx
index f70cc714..bffdfbe2 100644
--- a/unix/vncconfig/vncconfig.cxx
+++ b/unix/vncconfig/vncconfig.cxx
@@ -215,6 +215,10 @@ public:
if (cutText)
XFree(cutText);
cutText = (char*)malloc(nitems); // assuming XFree() same as free()
+ if (!cutText) {
+ vlog.error("unable to allocate selection buffer");
+ return;
+ }
memcpy(cutText, data, nitems);
cutTextLen = nitems;
vlog.debug("sending %s selection as server cut text: '%.*s%s'",