mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-29 07:55:59 +01:00
rootston: fix leak in handle_layer_shell_surface
Found through static analysis
This commit is contained in:
parent
bcc2c64c1e
commit
1e17f4deb6
1 changed files with 6 additions and 6 deletions
|
@ -381,12 +381,6 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
|
|||
layer_surface->client_pending.margin.bottom,
|
||||
layer_surface->client_pending.margin.left);
|
||||
|
||||
struct roots_layer_surface *roots_surface =
|
||||
calloc(1, sizeof(struct roots_layer_surface));
|
||||
if (!roots_surface) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!layer_surface->output) {
|
||||
struct roots_input *input = desktop->server->input;
|
||||
struct roots_seat *seat = input_last_active_seat(input);
|
||||
|
@ -409,6 +403,12 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
}
|
||||
|
||||
struct roots_layer_surface *roots_surface =
|
||||
calloc(1, sizeof(struct roots_layer_surface));
|
||||
if (!roots_surface) {
|
||||
return;
|
||||
}
|
||||
|
||||
roots_surface->surface_commit.notify = handle_surface_commit;
|
||||
wl_signal_add(&layer_surface->surface->events.commit,
|
||||
&roots_surface->surface_commit);
|
||||
|
|
Loading…
Reference in a new issue