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:
Alan Coopersmith
2015-03-21 10:52:29 -07:00
parent df4e41fdb4
commit b9e665c8b2
13 changed files with 71 additions and 76 deletions

View File

@@ -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;