--- chan_sip.c~ 2018-01-11 17:44:54.000000000 +0100 +++ chan_sip.c 2018-02-12 16:27:58.572141588 +0100 @@ -27174,7 +27174,7 @@ } else { sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); } - if (ast_str_strlen(p->initreq.data) > 0) { + if (p->initreq.data && ast_str_strlen(p->initreq.data) > 0) { struct sip_pkt *pkt, *prev_pkt; /* If the CANCEL we are receiving is a retransmission, and we already have scheduled * a reliable 487, then we don't want to schedule another one on top of the previous