Commit 897727b1 authored by Pekka Pessi's avatar Pekka Pessi

nta.c: fixed memory leak if INVITE never receives a response after 100 Trying. Bug #1626330.

darcs-hash:20070206151432-65a35-f6a582c5dbf61564689a3900c10ce4f75de8cbe2.gz
parent 8633f69c
......@@ -7535,6 +7535,14 @@ void outgoing_destroy(nta_outgoing_t *orq)
if (orq->orq_terminated || orq->orq_default) {
outgoing_free(orq);
}
/* We have to handle 200 OK statelessly =>
kill transaction immediately */
else if (orq->orq_method == sip_method_invite && !orq->orq_completed
/* (unless we have to wait to send CANCEL) */
&& !orq->orq_cancel) {
orq->orq_destroyed = 1;
outgoing_terminate(orq);
}
else {
orq->orq_destroyed = 1;
orq->orq_callback = outgoing_default_cb;
......@@ -7942,6 +7950,16 @@ int outgoing_recv(nta_outgoing_t *orq,
outgoing_send(cancel, 0);
else
outgoing_reply(cancel, SIP_481_NO_TRANSACTION, 0);
if (status < 300 && orq->orq_destroyed &&
orq->orq_method == sip_method_invite) {
outgoing_terminate(orq); /* We can now kill transaction */
if (status == 100) {
msg_destroy(msg);
return 0;
}
return -1;
}
}
if (orq->orq_pending) {
......
......@@ -103,8 +103,6 @@ typedef struct register_usage nua_registration_t;
TAG_IF((include) && (soa) && soa_is_remote_chat_active(soa) >= 0, \
SOATAG_ACTIVE_CHAT(soa_is_remote_chat_active(soa)))
#define HAVE_NUA_HANDLE_DEBUG 1
#if HAVE_NUA_HANDLE_DEBUG
#define nua_handle_ref(nh) nua_handle_ref_by((nh), __func__)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment