summaryrefslogtreecommitdiff
path: root/lib/libXfont2/src/bitmap/bitmaputil.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libXfont2/src/bitmap/bitmaputil.c')
-rw-r--r--lib/libXfont2/src/bitmap/bitmaputil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libXfont2/src/bitmap/bitmaputil.c b/lib/libXfont2/src/bitmap/bitmaputil.c
index 232729ffb..c2135a068 100644
--- a/lib/libXfont2/src/bitmap/bitmaputil.c
+++ b/lib/libXfont2/src/bitmap/bitmaputil.c
@@ -30,6 +30,7 @@ from The Open Group.
#include <config.h>
#endif
#include "libxfontint.h"
+#include "src/util/replace.h"
#include <X11/fonts/fntfilst.h>
#include <X11/fonts/bitmap.h>
@@ -210,7 +211,7 @@ bitmapAddInkMetrics(FontPtr pFont)
int i;
bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
- bitmapFont->ink_metrics = malloc(bitmapFont->num_chars * sizeof(xCharInfo));
+ bitmapFont->ink_metrics = mallocarray(bitmapFont->num_chars, sizeof(xCharInfo));
if (!bitmapFont->ink_metrics) {
fprintf(stderr, "Error: Couldn't allocate ink_metrics (%d*%ld)\n",
bitmapFont->num_chars, (unsigned long)sizeof(xCharInfo));