*** sm/pkt.c.orig Sat Sep 18 19:35:58 2004 --- sm/pkt.c Sat Sep 18 21:02:21 2004 *************** *** 352,362 **** --- 352,374 ---- jid_free(pkt->rto); pkt->rto = jid_new(pkt->sm->pc, pkt->to->domain, 0); + if(pkt->rto == NULL) { + log_debug(ZONE, "invalid to address on packet, unable to route"); + pkt_free(pkt); + return; + } + nad_set_attr(pkt->nad, 0, -1, "to", pkt->rto->domain, 0); if(pkt->rfrom != NULL) jid_free(pkt->rfrom); pkt->rfrom = jid_new(pkt->sm->pc, pkt->sm->id, 0); + + if(pkt->rfrom == NULL) { + log_debug(ZONE, "invalid from address on packet, unable to route"); + pkt_free(pkt); + return; + } nad_set_attr(pkt->nad, 0, -1, "from", pkt->rfrom->domain, 0);