changeset 1787:ce3ce75a6e04

Fix null pointer dereference removing listeners
author Matt Johnston <matt@ucc.asn.au>
date Mon, 07 Dec 2020 20:03:24 +0800
parents a3b39df57c8b
children 1fc0012b9c38
files listener.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/listener.c	Sun Dec 06 21:54:01 2020 +0800
+++ b/listener.c	Mon Dec 07 20:03:24 2020 +0800
@@ -139,7 +139,7 @@
 	struct Listener* listener;
 
 	for (i = 0, listener = ses.listeners[i]; i < ses.listensize; i++) {
-		if (listener->type == type
+		if (listener && listener->type == type
 				&& match(typedata, listener->typedata)) {
 			return listener;
 		}