diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-08-03 19:09:19 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-08-03 19:31:14 -0700 |
commit | f54470dab5b392380df61a22b4b4bef685b6cee2 (patch) | |
tree | 561d2a367f295f3fe53f72712b3b3f3d1011ec18 /src/stubs/atom.c | |
parent | 27207d35d4b4bbd5d2b2c5f7e13a61ea43d04a4a (diff) |
Convert multiplying realloc calls to use reallocarray instead
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/stubs/atom.c')
-rw-r--r-- | src/stubs/atom.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stubs/atom.c b/src/stubs/atom.c index 82c8ca3..804a4de 100644 --- a/src/stubs/atom.c +++ b/src/stubs/atom.c @@ -34,6 +34,7 @@ #include <config.h> #endif #include "libxfontint.h" +#include "src/util/replace.h" #include <X11/fonts/fontmisc.h> typedef struct _AtomList { @@ -122,7 +123,7 @@ ResizeReverseMap(void) newMapSize = 1000; else newMapSize = reverseMapSize * 2; - newMap = realloc(reverseMap, newMapSize * sizeof(AtomListPtr)); + newMap = reallocarray(reverseMap, newMapSize, sizeof(AtomListPtr)); if (newMap == NULL) { fprintf(stderr, "ResizeReverseMap(): Error: Couldn't reallocate" " reverseMap (%ld)\n", |