mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-05 05:05:57 +01:00
backend: fix use-after-free in wlr_backend_autocreate
Found by clang static analyzer.
This commit is contained in:
parent
cff471ce3e
commit
f9eb5df80e
1 changed files with 4 additions and 4 deletions
|
@ -217,16 +217,16 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
|
||||||
backend, &multi->session, name, create_renderer_func);
|
backend, &multi->session, name, create_renderer_func);
|
||||||
if (subbackend == NULL) {
|
if (subbackend == NULL) {
|
||||||
wlr_log(WLR_ERROR, "failed to start backend '%s'", name);
|
wlr_log(WLR_ERROR, "failed to start backend '%s'", name);
|
||||||
wlr_backend_destroy(backend);
|
|
||||||
wlr_session_destroy(multi->session);
|
wlr_session_destroy(multi->session);
|
||||||
|
wlr_backend_destroy(backend);
|
||||||
free(names);
|
free(names);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wlr_multi_backend_add(backend, subbackend)) {
|
if (!wlr_multi_backend_add(backend, subbackend)) {
|
||||||
wlr_log(WLR_ERROR, "failed to add backend '%s'", name);
|
wlr_log(WLR_ERROR, "failed to add backend '%s'", name);
|
||||||
wlr_backend_destroy(backend);
|
|
||||||
wlr_session_destroy(multi->session);
|
wlr_session_destroy(multi->session);
|
||||||
|
wlr_backend_destroy(backend);
|
||||||
free(names);
|
free(names);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -272,8 +272,8 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
|
||||||
multi->session);
|
multi->session);
|
||||||
if (!libinput) {
|
if (!libinput) {
|
||||||
wlr_log(WLR_ERROR, "Failed to start libinput backend");
|
wlr_log(WLR_ERROR, "Failed to start libinput backend");
|
||||||
wlr_backend_destroy(backend);
|
|
||||||
wlr_session_destroy(multi->session);
|
wlr_session_destroy(multi->session);
|
||||||
|
wlr_backend_destroy(backend);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
wlr_multi_backend_add(backend, libinput);
|
wlr_multi_backend_add(backend, libinput);
|
||||||
|
@ -283,8 +283,8 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
|
||||||
if (!primary_drm) {
|
if (!primary_drm) {
|
||||||
wlr_log(WLR_ERROR, "Failed to open any DRM device");
|
wlr_log(WLR_ERROR, "Failed to open any DRM device");
|
||||||
wlr_backend_destroy(libinput);
|
wlr_backend_destroy(libinput);
|
||||||
wlr_backend_destroy(backend);
|
|
||||||
wlr_session_destroy(multi->session);
|
wlr_session_destroy(multi->session);
|
||||||
|
wlr_backend_destroy(backend);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue