From a6eaa8c12122886f6ab09a459a0ddbb8d6e925e2 Mon Sep 17 00:00:00 2001 From: Richard Aas Date: Fri, 16 Dec 2011 13:37:52 +0000 Subject: [PATCH] avoid calling notify handler if terminated --- src/sipevent/listen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sipevent/listen.c b/src/sipevent/listen.c index c18a835..3c93f0e 100644 --- a/src/sipevent/listen.c +++ b/src/sipevent/listen.c @@ -217,6 +217,9 @@ static void notify_handler(struct sipevent_sock *sock, break; } + if (sub->terminated) + return; + mem_ref(sub); sub->notifyh(msg, sub->arg); nrefs = mem_nrefs(sub); @@ -226,7 +229,7 @@ static void notify_handler(struct sipevent_sock *sock, if (nrefs == 1) return; - if (!sub->terminated && state.state == SIPEVENT_TERMINATED) + if (state.state == SIPEVENT_TERMINATED) sipsub_terminate(sub, 0, msg); }