diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c index f617537cf..16826713e 100644 --- a/xkb/xkbLEDs.c +++ b/xkb/xkbLEDs.c @@ -714,10 +714,12 @@ XkbSrvLedInfoPtr sli; } } } - if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask)) - sli->names= calloc(XkbNumIndicators, sizeof(Atom)); - if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask)) - sli->maps= calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec)); + if (sli) { + if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask)) + sli->names= calloc(XkbNumIndicators, sizeof(Atom)); + if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask)) + sli->maps= calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec)); + } return sli; }