render: handle -Wanalyzer-null-dereference in AllocateGlyphHash()

Reported in #1817:
xwayland-24.1.6/redhat-linux-build/../render/glyph.c:388:26:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘hashSet’

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2166>
This commit is contained in:
Alan Coopersmith 2026-03-30 18:07:15 -07:00 committed by Marge Bot
parent c5ecfa5eea
commit 9bbba2bccc

View file

@ -385,6 +385,8 @@ AllocateGlyph(xGlyphInfo * gi, int fdepth)
static Bool
AllocateGlyphHash(GlyphHashPtr hash, GlyphHashSetPtr hashSet)
{
if (hashSet == NULL)
return FALSE;
hash->table = calloc(hashSet->size, sizeof(GlyphRefRec));
if (!hash->table)
return FALSE;