mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-21 14:42:25 +00:00
backend/drm: Ensure renderer is set to NULL on error
If init_drm_renderer failed, it would destroy the renderer but would not set it to NULL, leading to use-after-free. NULL the renderer after destroying it.
This commit is contained in:
parent
70d3635985
commit
55f15d1abd
@ -25,6 +25,7 @@ bool init_drm_renderer(struct wlr_drm_backend *drm,
|
|||||||
if (renderer->allocator == NULL) {
|
if (renderer->allocator == NULL) {
|
||||||
wlr_log(WLR_ERROR, "Failed to create allocator");
|
wlr_log(WLR_ERROR, "Failed to create allocator");
|
||||||
wlr_renderer_destroy(renderer->wlr_rend);
|
wlr_renderer_destroy(renderer->wlr_rend);
|
||||||
|
renderer->wlr_rend = NULL;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user