summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-04-04 15:01:53 +1030
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-04-04 15:01:53 +1030
commit502689847b86be5619da7134646d55a1ac322a2c (patch)
tree01e47c58ae1b506c5cb05d5462824275284847ea
parent035b1b6995e670ce5593e8aceb08f9ec812c70ea (diff)
Xi: ALLOC_COPY_CLASS_IF should only alloc if to->field doesn't exist.
-rw-r--r--Xi/exevents.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index b2403bc11..c16b0c888 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -363,9 +363,12 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to)
#define ALLOC_COPY_CLASS_IF(field, type) \
if (from->field)\
{ \
- to->field = xcalloc(1, sizeof(type)); \
if (!to->field) \
+ { \
+ to->field = xcalloc(1, sizeof(type)); \
+ if (!to->field) \
FatalError("[Xi] no memory for class shift.\n"); \
+ } \
memcpy(to->field, from->field, sizeof(type)); \
}