diff options
Diffstat (limited to 'src/util/fontutil.c')
-rw-r--r-- | src/util/fontutil.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/fontutil.c b/src/util/fontutil.c index f7ac507..fd87d77 100644 --- a/src/util/fontutil.c +++ b/src/util/fontutil.c @@ -137,7 +137,7 @@ xfont2_query_text_extents(FontPtr pFont, unsigned char defc[2]; int firstReal; - charinfo = malloc(count * sizeof(xCharInfo *)); + charinfo = mallocarray(count, sizeof(xCharInfo *)); if (!charinfo) return FALSE; encoding = TwoD16Bit; @@ -303,7 +303,7 @@ add_range(fsRange *newrange, /* Grow the list if necessary */ if (*nranges == 0 || *range == (fsRange *)0) { - *range = malloc(range_alloc_granularity * SIZEOF(fsRange)); + *range = mallocarray(range_alloc_granularity, SIZEOF(fsRange)); *nranges = 0; } else if (!(*nranges % range_alloc_granularity)) |