From 20b99ed85434837f31107337631f003de235b4d4 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Wed, 17 Jan 2024 01:55:01 +0300 Subject: render/drm_format_set: fix possible leak on realloc error --- render/drm_format_set.c | 1 + 1 file changed, 1 insertion(+) (limited to 'render') diff --git a/render/drm_format_set.c b/render/drm_format_set.c index 1b837fa5..e24152f6 100644 --- a/render/drm_format_set.c +++ b/render/drm_format_set.c @@ -74,6 +74,7 @@ bool wlr_drm_format_set_add(struct wlr_drm_format_set *set, uint32_t format, struct wlr_drm_format *fmts = realloc(set->formats, sizeof(*fmts) * capacity); if (!fmts) { wlr_log_errno(WLR_ERROR, "Allocation failed"); + wlr_drm_format_finish(&fmt); return false; } -- cgit v1.2.3