diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2018-03-22 19:57:11 +0100 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2018-03-22 21:27:49 +0100 |
commit | e86cd4dc33e495c2e5cacd319ba75984ea19a868 (patch) | |
tree | 90134db94aa17a09335465451c145c9b28be9dd0 | |
parent | d5e14ab2470032a5f8152c685415724a4734b492 (diff) |
wlr_pointer: fix potential null deref
if pointer is null here we'd access pointer->events... anyway
-rw-r--r-- | types/wlr_pointer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/types/wlr_pointer.c b/types/wlr_pointer.c index bc9efd8c..9d5dc08c 100644 --- a/types/wlr_pointer.c +++ b/types/wlr_pointer.c @@ -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); |