summaryrefslogtreecommitdiff
path: root/src/bitmap/bitmaputil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bitmap/bitmaputil.c')
-rw-r--r--src/bitmap/bitmaputil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bitmap/bitmaputil.c b/src/bitmap/bitmaputil.c
index 232729f..c2135a0 100644
--- a/src/bitmap/bitmaputil.c
+++ b/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));