aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2024-01-17 01:55:01 +0300
committerSimon Ser <contact@emersion.fr>2024-01-17 15:44:37 +0000
commit20b99ed85434837f31107337631f003de235b4d4 (patch)
treefc75a5e34ba0369b94dd9949f0c04031129c4d9d /render
parent3eb89e53252d3d4ce164f3a9abb99231f280240d (diff)
render/drm_format_set: fix possible leak on realloc error
Diffstat (limited to 'render')
-rw-r--r--render/drm_format_set.c1
1 files changed, 1 insertions, 0 deletions
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;
}