diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-01-24 23:42:49 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-01-25 18:54:16 +1000 |
commit | 9fc19168e7ca6308275bf8769d1ccb982f88465b (patch) | |
tree | d85805a8e345e4a0f422f082a2a7140afb08c6a3 /Xi | |
parent | 76b3be75b62657e346731444736f7e4d200beb5b (diff) |
Check for calloc() failure in add_master()
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/xichangehierarchy.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index e2f4b8a0a..9e36354d1 100644 --- a/Xi/xichangehierarchy.c +++ b/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, |