Fix null pointer dereference removing listeners

This commit is contained in:
Matt Johnston 2020-12-07 20:03:24 +08:00
parent e12ff23e7d
commit a6b2eeb190

View File

@ -139,7 +139,7 @@ struct Listener * get_listener(int type, const void* typedata,
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;
}