add: if (shmem_msg->dst_uri.s!=0 && shmem_msg->dst_uri.len!=0) { faked_req->dst_uri.s=pkg_malloc(shmem_msg->dst_uri.len+1); if (!faked_req->dst_uri.s) { LOG(L_ERR, "ERROR: fake_req: no uri/pkg mem\n"); goto error00; } faked_req->dst_uri.len=shmem_msg->dst_uri.len; memcpy( faked_req->dst_uri.s, shmem_msg->dst_uri.s, faked_req->dst_uri.len); faked_req->dst_uri.s[faked_req->dst_uri.len]=0; }
context: static inline int fake_req(struct sip_msg *faked_req, 				struct sip_msg *shmem_msg){	/* on_negative_reply faked msg now copied from shmem msg (as opposed	 * to zero-ing) -- more "read-only" actions (exec in particular) will	 * work from reply_route as they will see msg->from, etc.; caution,	 * rw actions may append some pkg stuff to msg, which will possibly be	 * never released (shmem is released in a single block) */	memcpy( faked_req, shmem_msg, sizeof(struct sip_msg));	/* if we set msg_id to something different from current's message	 * id, the first t_fork will properly clean new branch URIs */	faked_req->id=shmem_msg->id-1;	/* msg->parsed_uri_ok must be reset since msg_parsed_uri is	 * not cloned (and cannot be cloned) */	faked_req->parsed_uri_ok = 0;	/* new_uri can change -- make a private copy */	if (shmem_msg->new_uri.s!=0 && shmem_msg->new_uri.len!=0) {		faked_req->new_uri.s=pkg_malloc(shmem_msg->new_uri.len+1);		if (!faked_req->new_uri.s) {			LOG(L_ERR, "ERROR: fake_req: no uri/pkg mem\n");			goto error00;		}		faked_req->new_uri.len=shmem_msg->new_uri.len;		memcpy( faked_req->new_uri.s, shmem_msg->new_uri.s, 			faked_req->new_uri.len);		faked_req->new_uri.s[faked_req->new_uri.len]=0;	}	return 1;error00:	return 0;}