mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-04 20:55:58 +01:00
wlr_pointer: fix potential null deref
if pointer is null here we'd access pointer->events... anyway
This commit is contained in:
parent
d5e14ab247
commit
e86cd4dc33
1 changed files with 4 additions and 1 deletions
|
@ -14,7 +14,10 @@ void wlr_pointer_init(struct wlr_pointer *pointer,
|
|||
}
|
||||
|
||||
void wlr_pointer_destroy(struct wlr_pointer *pointer) {
|
||||
if (pointer && pointer->impl && pointer->impl->destroy) {
|
||||
if (!pointer) {
|
||||
return;
|
||||
}
|
||||
if (pointer->impl && pointer->impl->destroy) {
|
||||
pointer->impl->destroy(pointer);
|
||||
} else {
|
||||
wl_list_remove(&pointer->events.motion.listener_list);
|
||||
|
|
Loading…
Reference in a new issue