mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
Convert dix/* to new *allocarray functions
v2: remove now useless parentheses Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
@@ -510,7 +510,7 @@ CreateNewResourceType(DeleteType deleteFunc, const char *name)
|
||||
|
||||
if (next & lastResourceClass)
|
||||
return 0;
|
||||
types = realloc(resourceTypes, (next + 1) * sizeof(*resourceTypes));
|
||||
types = reallocarray(resourceTypes, next + 1, sizeof(*resourceTypes));
|
||||
if (!types)
|
||||
return 0;
|
||||
|
||||
@@ -834,10 +834,10 @@ RebuildTable(int client)
|
||||
*/
|
||||
|
||||
j = 2 * clientTable[client].buckets;
|
||||
tails = malloc(j * sizeof(ResourcePtr *));
|
||||
tails = xallocarray(j, sizeof(ResourcePtr *));
|
||||
if (!tails)
|
||||
return;
|
||||
resources = malloc(j * sizeof(ResourcePtr));
|
||||
resources = xallocarray(j, sizeof(ResourcePtr));
|
||||
if (!resources) {
|
||||
free(tails);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user