aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi/xichangehierarchy.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xi/xichangehierarchy.c')
-rw-r--r--xorg-server/Xi/xichangehierarchy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xorg-server/Xi/xichangehierarchy.c b/xorg-server/Xi/xichangehierarchy.c
index e2f4b8a0a..9e36354d1 100644
--- a/xorg-server/Xi/xichangehierarchy.c
+++ b/xorg-server/Xi/xichangehierarchy.c
@@ -143,6 +143,10 @@ add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES])
int rc;
name = calloc(c->name_len + 1, sizeof(char));
+ if (name == NULL) {
+ rc = BadAlloc;
+ goto unwind;
+ }
strncpy(name, (char *) &c[1], c->name_len);
rc = AllocDevicePair(client, name, &ptr, &keybd,