diff --git a/channels/chan_sip.c b/channels/chan_sip.c index e8d9e4550c..99f914f447 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5676,7 +5676,7 @@ static int sip_hangup(struct ast_channel *ast) } } else { /* Incoming call, not up */ const char *res; - AST_SCHED_DEL(sched, p->provisional_keepalive_sched_id); + AST_SCHED_DEL_UNREF(sched, p->provisional_keepalive_sched_id, dialog_unref(p, "when you delete the provisional_keepalive_sched_id, you should dec the refcount for the stored dialog ptr")); if (p->hangupcause && (res = hangup_cause2sip(p->hangupcause))) transmit_response_reliable(p, res, &p->initreq); else