Also unref the pvt when we delete the provisional keepalive job.
[asterisk/asterisk.git] / channels / chan_sip.c
index e8d9e45..99f914f 100644 (file)
@@ -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