summaryrefslogtreecommitdiff
path: root/src/util/private.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2019-08-03 19:29:05 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2019-08-04 11:23:20 -0700
commitddbee30d3525cdd66b84056affc407601680cc29 (patch)
treeae251a90a3e4cd3420d361edba93a4ea3656babc /src/util/private.c
parentf54470dab5b392380df61a22b4b4bef685b6cee2 (diff)
Convert multiplying malloc calls to use mallocarray instead
Introduces mallocarray as a macro calling reallocarray with a NULL pointer for the old allocation. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/util/private.c')
-rw-r--r--src/util/private.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/private.c b/src/util/private.c
index 47c2699..b07a757 100644
--- a/src/util/private.c
+++ b/src/util/private.c
@@ -90,7 +90,7 @@ xfont2_font_set_private(FontPtr pFont, int n, pointer ptr)
return FALSE;
} else {
/* omg realloc */
- new = malloc ((n + 1) * sizeof (pointer));
+ new = reallocarray (NULL, (n + 1), sizeof (pointer));
if (!new)
return FALSE;
if (pFont->devPrivates)