rem: *_r = res;
context: int parse_rr(str* _s, rr_t** _r){	rr_t* r, *res, *last;	str s;	param_hooks_t hooks;	if (!_s || !_r) {		LOG(L_ERR, "parse_rr(): Invalid parameter value\n");		return -1;	}	     /* Make a temporary copy of the string */	s.s = _s->s;	s.len = _s->len;	res = last = 0;	while(1) {		     /* Allocate and clear rr stucture */		r = (rr_t*)pkg_malloc(sizeof(rr_t));		if (!r) {			LOG(L_ERR, "parse_rr(): No memory left\n");			goto error;		}		memset(r, 0, sizeof(rr_t));				     /* Parse name-addr part of the header */		if (parse_nameaddr(_s, &r->nameaddr) < 0) {			LOG(L_ERR, "parse_rr(): Error while parsing name-addr\n");			goto error;		}				     /* Shift just behind the closing > */		s.s = r->nameaddr.uri.s + r->nameaddr.uri.len + 1; /* Point just behind > */		s.len -= r->nameaddr.name.len + r->nameaddr.uri.len + 2;		     /* Nothing left, finish */		if (s.len == 0) goto ok;				if (s.s[0] == ';') {         /* Contact parameter found */			s.s++;			s.len--;			trim_leading(&s);						if (s.len == 0) {				LOG(L_ERR, "parse_rr(): Error while parsing params\n");				goto error;			}			     /* Parse all parameters */			if (parse_params(&s, CLASS_RR, &hooks, &r->params) < 0) {				LOG(L_ERR, "parse_rr(): Error while parsing params\n");				goto error;			}			     /* Copy hooks */			r->lr = hooks.rr.lr;			r->r2 = hooks.rr.r2;			if (s.len == 0) goto ok;		}		     /* Next character is comma or end of header*/		s.s++;		s.len--;		trim_leading(&s);		if (s.len == 0) {			LOG(L_ERR, "parse_rr(): Text after comma missing\n");			goto error;		}		     /* Append the structure as last parameter of the linked list */		if (!res) res = r;		if (last) last->next = r;		last = r;	} error:	if (r) pkg_free(r);	free_rr(res); /* Free any contacts created so far */	return -1; ok:	if (last) last->next = r;	*_r = res;	return 0;}