diff --git a/hw/xwayland/xwayland-drm-lease.c b/hw/xwayland/xwayland-drm-lease.c index 76f2572a6..cd810c4cc 100644 --- a/hw/xwayland/xwayland-drm-lease.c +++ b/hw/xwayland/xwayland-drm-lease.c @@ -242,7 +242,7 @@ xwl_get_rrmodes_from_connector_id(int drm, int32_t connector_id, int *nmode, int ErrorF("drmModeGetConnector for connector %d failed\n", connector_id); return NULL; } - rrmodes = xallocarray(conn->count_modes, sizeof(RRModePtr)); + rrmodes = calloc(conn->count_modes, sizeof(RRModePtr)); if (!rrmodes) { ErrorF("Failed to allocate connector modes\n"); drmModeFreeConnector(conn); diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 8350279a3..ddcd40ad0 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -359,7 +359,8 @@ output_get_rr_modes(struct xwl_output *xwl_output, RRModePtr *rr_modes; int i; - rr_modes = xallocarray(ARRAY_SIZE(xwl_output_fake_modes) + 1, sizeof(RRModePtr)); + rr_modes = calloc(ARRAY_SIZE(xwl_output_fake_modes) + 1, + sizeof(RRModePtr)); if (!rr_modes) goto err; @@ -1230,7 +1231,7 @@ xwl_randr_add_modes_fixed(struct xwl_output *xwl_output, RRModePtr mode; int i, nmodes, current; - modes = xallocarray(ARRAY_SIZE(xwl_output_fake_modes) + 1, sizeof(RRModePtr)); + modes = calloc(ARRAY_SIZE(xwl_output_fake_modes) + 1, sizeof(RRModePtr)); if (!modes) { ErrorF("Failed to allocated RandR modes\n"); return FALSE;