summaryrefslogtreecommitdiff
path: root/src/util/private.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/private.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/private.c')
-rw-r--r--src/util/private.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/private.c b/src/util/private.c
index 92075c2..47c2699 100644
--- a/src/util/private.c
+++ b/src/util/private.c
@@ -32,6 +32,7 @@ in this Software without prior written authorization 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>
@@ -84,7 +85,7 @@ xfont2_font_set_private(FontPtr pFont, int n, pointer ptr)
if (n > pFont->maxPrivate) {
if (pFont->devPrivates && pFont->devPrivates != (pointer)(&pFont[1])) {
- new = realloc (pFont->devPrivates, (n + 1) * sizeof (pointer));
+ new = reallocarray (pFont->devPrivates, (n + 1), sizeof (pointer));
if (!new)
return FALSE;
} else {