summaryrefslogtreecommitdiff
path: root/src/util/fontutil.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2019-08-03 19:09:19 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2019-08-03 19:31:14 -0700
commitf54470dab5b392380df61a22b4b4bef685b6cee2 (patch)
tree561d2a367f295f3fe53f72712b3b3f3d1011ec18 /src/util/fontutil.c
parent27207d35d4b4bbd5d2b2c5f7e13a61ea43d04a4a (diff)
Convert multiplying realloc calls to use reallocarray instead
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/util/fontutil.c')
-rw-r--r--src/util/fontutil.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/fontutil.c b/src/util/fontutil.c
index d1b845b..f7ac507 100644
--- a/src/util/fontutil.c
+++ b/src/util/fontutil.c
@@ -34,6 +34,7 @@ from The Open Group.
#include <config.h>
#endif
#include "libxfontint.h"
+#include "src/util/replace.h"
#include <X11/fonts/fontmisc.h>
#include <X11/fonts/fontstruct.h>
#include <X11/fonts/FSproto.h>
@@ -307,8 +308,8 @@ add_range(fsRange *newrange,
}
else if (!(*nranges % range_alloc_granularity))
{
- *range = realloc(*range, (*nranges + range_alloc_granularity) *
- SIZEOF(fsRange));
+ *range = reallocarray(*range, (*nranges + range_alloc_granularity),
+ SIZEOF(fsRange));
}
/* If alloc failed, just return a null list */