Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 211037) +++ channels/chan_sip.c (working copy) @@ -2249,8 +2249,12 @@ * the packet's retransid will be set to -1. The atomicity of the setting and checking * of the retransid to -1 is ensured since in both cases p's lock is held. */ - AST_SCHED_DEL_SPINLOCK(sched, cur->retransid, &p->lock); - free(cur); + if (AST_SCHED_DEL_SPINLOCK(sched, cur->retransid, &p->lock)) { + cur->next = p->packets; + p->packets = cur; + } else { + free(cur); + } break; } }