diff options
Diffstat (limited to 'xorg-server/dix/atom.c')
-rw-r--r-- | xorg-server/dix/atom.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xorg-server/dix/atom.c b/xorg-server/dix/atom.c index 22cd0dc0e..7de7fb05e 100644 --- a/xorg-server/dix/atom.c +++ b/xorg-server/dix/atom.c @@ -119,7 +119,7 @@ MakeAtom(const char *string, unsigned len, Bool makeit) if ((lastAtom + 1) >= tableLength) { NodePtr *table; - table = realloc(nodeTable, tableLength * (2 * sizeof(NodePtr))); + table = reallocarray(nodeTable, tableLength, 2 * sizeof(NodePtr)); if (!table) { if (nd->string != string) { /* nd->string has been strdup'ed */ @@ -200,7 +200,7 @@ InitAtoms(void) { FreeAllAtoms(); tableLength = InitialTableSize; - nodeTable = malloc(InitialTableSize * sizeof(NodePtr)); + nodeTable = xallocarray(InitialTableSize, sizeof(NodePtr)); if (!nodeTable) AtomError(); nodeTable[None] = NULL; |