diff --git a/xkb/maprules.c b/xkb/maprules.c index 8a1944ef5..529650363 100644 --- a/xkb/maprules.c +++ b/xkb/maprules.c @@ -93,7 +93,7 @@ InputLineAddChar(InputLine * line, int ch) { if (line->num_line >= line->sz_line) { if (line->line == line->buf) { - line->line = xallocarray(line->sz_line, 2); + line->line = calloc(line->sz_line, 2); memcpy(line->line, line->buf, line->sz_line); } else { diff --git a/xkb/xkb.c b/xkb/xkb.c index 744dba63d..dcac6a8b5 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -2837,7 +2837,7 @@ XkbSendCompatMap(ClientPtr client, int size; if (rep->length > 0) { - data = xallocarray(rep->length, 4); + data = calloc(rep->length, 4); if (data) { register unsigned i, bit; xkbModsWireDesc *grp; @@ -3224,7 +3224,7 @@ XkbSendIndicatorMap(ClientPtr client, if (rep->length > 0) { CARD8 *to; - to = map = xallocarray(rep->length, 4); + to = map = calloc(rep->length, 4); if (map) { xkbIndicatorMapWireDesc *wire = (xkbIndicatorMapWireDesc *) to; @@ -5036,7 +5036,7 @@ XkbSendGeometry(ClientPtr client, int len; if (geom != NULL) { - start = desc = xallocarray(rep->length, 4); + start = desc = calloc(rep->length, 4); if (!start) return BadAlloc; len = rep->length * 4; diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c index 8ca92bd15..f1ab70a45 100644 --- a/xkb/xkbUtils.c +++ b/xkb/xkbUtils.c @@ -1065,8 +1065,8 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst) } else if (!dtype->map_count || !dtype->map || i >= dst->map->num_types) { - tmp = xallocarray(stype->map_count, - sizeof(XkbKTMapEntryRec)); + tmp = calloc(stype->map_count, + sizeof(XkbKTMapEntryRec)); if (!tmp) return FALSE; dtype->map = tmp; @@ -1094,8 +1094,7 @@ _XkbCopyClientMap(XkbDescPtr src, XkbDescPtr dst) } else if (!dtype->preserve || !dtype->map_count || i >= dst->map->num_types) { - tmp = xallocarray(stype->map_count, - sizeof(XkbModsRec)); + tmp = calloc(stype->map_count, sizeof(XkbModsRec)); if (!tmp) return FALSE; dtype->preserve = tmp; @@ -1605,8 +1604,8 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) j < sshape->num_outlines; j++, soutline++, doutline++) { if (soutline->num_points) { - tmp = xallocarray(soutline->num_points, - sizeof(XkbPointRec)); + tmp = calloc(soutline->num_points, + sizeof(XkbPointRec)); if (!tmp) return FALSE; doutline->points = tmp; @@ -1733,7 +1732,7 @@ _XkbCopyGeom(XkbDescPtr src, XkbDescPtr dst) for (j = 0, srow = ssection->rows, drow = dsection->rows; j < ssection->num_rows; j++, srow++, drow++) { if (srow->num_keys) { - tmp = xallocarray(srow->num_keys, sizeof(XkbKeyRec)); + tmp = calloc(srow->num_keys, sizeof(XkbKeyRec)); if (!tmp) return FALSE; drow->keys = tmp;