aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-03-22 19:57:11 +0100
committerDominique Martinet <asmadeus@codewreck.org>2018-03-22 21:27:49 +0100
commite86cd4dc33e495c2e5cacd319ba75984ea19a868 (patch)
tree90134db94aa17a09335465451c145c9b28be9dd0
parentd5e14ab2470032a5f8152c685415724a4734b492 (diff)
wlr_pointer: fix potential null deref
if pointer is null here we'd access pointer->events... anyway
-rw-r--r--types/wlr_pointer.c5
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);