diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/glyph.c | 3 | ||||
-rw-r--r-- | render/picture.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/render/glyph.c b/render/glyph.c index ae04f6029..87b332e2a 100644 --- a/render/glyph.c +++ b/render/glyph.c @@ -441,10 +441,9 @@ bail: Bool AllocateGlyphHash (GlyphHashPtr hash, GlyphHashSetPtr hashSet) { - hash->table = (GlyphRefPtr) xalloc (hashSet->size * sizeof (GlyphRefRec)); + hash->table = xcalloc (hashSet->size, sizeof (GlyphRefRec)); if (!hash->table) return FALSE; - memset (hash->table, 0, hashSet->size * sizeof (GlyphRefRec)); hash->hashSet = hashSet; hash->tableEntries = 0; return TRUE; diff --git a/render/picture.c b/render/picture.c index 9def47b0f..fc2bf43d5 100644 --- a/render/picture.c +++ b/render/picture.c @@ -316,10 +316,9 @@ PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp) } - pFormats = (PictFormatPtr) xalloc (nformats * sizeof (PictFormatRec)); + pFormats = xcalloc (nformats, sizeof (PictFormatRec)); if (!pFormats) return 0; - memset (pFormats, '\0', nformats * sizeof (PictFormatRec)); for (f = 0; f < nformats; f++) { pFormats[f].id = FakeClientID (0); |