state-helpers: use shared xmalloc

Just use the shared xmalloc() instead of malloc+assert

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2026-02-23 14:24:54 -06:00
parent 1f7bdea5c4
commit 0dd1d390be

View file

@ -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. */