rem: LOG(L_ERR, "add_uri_param(): setting new ruri <%.*s>\n", new_uri.len, new_uri.s);
context: int add_uri_param(struct sip_msg* _msg, char* _param, char* _s2){	str *param, *cur_uri, new_uri;	struct sip_uri *parsed_uri;	char *at;	param = (str*)_param;	if (param->len == 0) {		return 1;	}	if (parse_sip_msg_uri(_msg) < 0) {	        LOG(L_ERR, "add_uri_param(): ruri parsing failed\n");	        return -1;	}	parsed_uri = &(_msg->parsed_uri);	/* if current ruri has no headers, pad param at the end */	if (parsed_uri->headers.len == 0) {		cur_uri =  GET_RURI(_msg);		new_uri.len = cur_uri->len + param->len + 1;		if (new_uri.len > MAX_URI_SIZE) {			LOG(L_ERR, "add_uri_param(): new ruri too long\n");			return -1;		}		new_uri.s = pkg_malloc(new_uri.len);		if (new_uri.s == 0) {			LOG(L_ERR, "add_uri_param(): Memory allocation failure\n");			return -1;		}		memcpy(new_uri.s, cur_uri->s, cur_uri->len);		*(new_uri.s + cur_uri->len) = ';';		memcpy(new_uri.s + cur_uri->len + 1, param->s, param->len);		LOG(L_ERR, "add_uri_param(): setting new ruri <%.*s>\n",		    new_uri.len, new_uri.s);		if (set_uri(_msg, new_uri.s, new_uri.len) == 1) {			LOG(L_ERR, "add_uri_param(): setting new ruri success\n");			goto ok;		} else {			goto nok;		}	}	/* otherwise take the long path */	new_uri.len = 4 +		(parsed_uri->user.len ? parsed_uri->user.len + 1 : 0) +		(parsed_uri->passwd.len ? parsed_uri->passwd.len + 1 : 0) +		parsed_uri->host.len +		(parsed_uri->port.len ? parsed_uri->port.len + 1 : 0) +		parsed_uri->params.len + param->len + 1 +		parsed_uri->headers.len + 1;	if (new_uri.len > MAX_URI_SIZE) {	        LOG(L_ERR, "add_uri_param(): new ruri too long\n");		return -1;	}	new_uri.s = pkg_malloc(new_uri.len);	if (new_uri.s == 0) {		LOG(L_ERR, "add_uri_param(): Memory allocation failure\n");		return -1;	}	at = new_uri.s;	memcpy(at, "sip:", 4);	at = at + 4;	if (parsed_uri->user.len) {		memcpy(at, parsed_uri->user.s, parsed_uri->user.len);		if (parsed_uri->passwd.len) {			*at = ':';			at = at + 1;			memcpy(at, parsed_uri->passwd.s, parsed_uri->passwd.len);			at = at + parsed_uri->passwd.len;		};		*at = '@';		at = at + 1;	}	memcpy(at, parsed_uri->host.s, parsed_uri->host.len);	at = at + parsed_uri->host.len;	if (parsed_uri->port.len) {		*at = ':';		at = at + 1;		memcpy(at, parsed_uri->port.s, parsed_uri->port.len);		at = at + parsed_uri->port.len;	}	memcpy(at, parsed_uri->params.s, parsed_uri->params.len);	at = at + parsed_uri->params.len;	*at = ';';	at = at + 1;	memcpy(at, param->s, param->len);	at = at + param->len;	*at = '?';	at = at + 1;	memcpy(at, parsed_uri->headers.s, parsed_uri->headers.len);	if (set_uri(_msg, new_uri.s, new_uri.len) == 1) {		goto ok;	}nok:	pkg_free(new_uri.s);	return -1;ok:	pkg_free(new_uri.s);	return 1;}