diff --git a/src/xkb/XKBGAlloc.c b/src/xkb/XKBGAlloc.c index 5b02f34c..cb3904a8 100644 --- a/src/xkb/XKBGAlloc.c +++ b/src/xkb/XKBGAlloc.c @@ -879,7 +879,7 @@ XkbAddGeomDoodad(XkbGeometryPtr geom, XkbSectionPtr section, Atom name) return doodad; } if (section) { - if ((section->num_doodads >= geom->sz_doodads) && + if ((section->num_doodads >= section->sz_doodads) && (_XkbAllocDoodads(section, 1) != Success)) { return NULL; }