From 0dd1d390be49b61802770ab8dbd861cc452886e1 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Mon, 23 Feb 2026 14:24:54 -0600 Subject: [PATCH] state-helpers: use shared xmalloc Just use the shared xmalloc() instead of malloc+assert Signed-off-by: Derek Foreman --- libweston/backend-drm/state-helpers.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libweston/backend-drm/state-helpers.c b/libweston/backend-drm/state-helpers.c index aff585761..18a00fca5 100644 --- a/libweston/backend-drm/state-helpers.c +++ b/libweston/backend-drm/state-helpers.c @@ -34,6 +34,7 @@ #include "drm-internal.h" #include "shared/weston-drm-fourcc.h" +#include "shared/xalloc.h" /** * Allocate a new, empty, plane state. @@ -400,11 +401,9 @@ drm_output_state_duplicate(struct drm_output_state *src, struct drm_pending_state *pending_state, enum drm_output_state_duplicate_mode plane_mode) { - struct drm_output_state *dst = malloc(sizeof(*dst)); + struct drm_output_state *dst = xmalloc(sizeof(*dst)); struct drm_plane_state *ps; - assert(dst); - /* Copy the whole structure, then individually modify the * pending_state, as well as the list link into our pending * state. */