mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-04 07:15:59 -04:00
render/drm_format_set: fix possible leak on realloc error
This commit is contained in:
parent
3eb89e5325
commit
20b99ed854
1 changed files with 1 additions and 0 deletions
|
|
@ -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);
|
struct wlr_drm_format *fmts = realloc(set->formats, sizeof(*fmts) * capacity);
|
||||||
if (!fmts) {
|
if (!fmts) {
|
||||||
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
||||||
|
wlr_drm_format_finish(&fmt);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue