rem: free_uri_format (*format);
add: free_uri_format (format);
context: decode2format (str uri, char separator, struct uri_format *format){	char *start, *end, *string, *pos;	int foo;	int len;	memset (format, 0, sizeof ((*format)));	if (uri.s == NULL)		return -1;	/* sip:enc_pref*username*password*ip*port*protocol@public_ip */	len = 0;	string = uri.s;	start = q_memchr (string, ':', uri.len - len);	if (start == NULL)	{		foo = -3;		goto error1;	}			/* invalid uri */	start = start + 1;	/* jumping over sip: */	(*format).first = start - string;	len = start - string;	/* jumping over encoding prefix */	start = q_memchr (start, separator, uri.len - len);	if (start == NULL)	/* should not be , wrong encoding or */	{		foo = -9;		goto error1;	}	if (uri.len - len > 0) start = start + 1;	len = (start - string);	/* username */	end = q_memchr (start, separator, uri.len - len);	if (end == NULL)	/* should not be , wrong encoding or */	{		foo = -4;		goto error1;	}	if ((end - start) != 0)	{		(*format).username.s = pkg_malloc (end - start);		(*format).username.len = end - start;		memcpy ((*format).username.s, start, end - start);		fprintf (stdout, "username=%.*s\n", (*format).username.len,			 (*format).username.s);	}	if (uri.len - len > 0) start = end + 1;	/* now start is after * */	len = (start - string);	/* password */	end = q_memchr (start, separator, uri.len - len);	if (end == NULL)	/* should not be , wrong encoding or */	{		foo = -5;		goto error1;	}	if ((end - start) != 0)	{		(*format).password.s = pkg_malloc (end - start);		(*format).password.len = end - start;		memcpy ((*format).password.s, start, end - start);		fprintf (stdout, "password=%.*s\n", (*format).password.len,			 (*format).password.s);	}	if (uri.len - len > 0) start = end + 1;	/* now start is after * */	len = (start - string);	/* ip */	end = q_memchr (start, separator, uri.len - len);	if (end == NULL)	/* should not be , wrong encoding or */	{		foo = -6;		goto error1;	}	if ((end - start) != 0)	{		(*format).ip.s = pkg_malloc (end - start);		(*format).ip.len = end - start;		memcpy ((*format).ip.s, start, end - start);		fprintf (stdout, "ip=%.*s\n", (*format).ip.len, (*format).ip.s);	}	if (uri.len - len > 0) start = end + 1;	/* now start is after * */	len = (start - string);	/* port */	end = q_memchr (start, separator, uri.len - len);	if (end == NULL)	/* should not be , wrong encoding or */	{		foo = -7;		goto error1;	}	if ((end - start) != 0)	{		(*format).port.s = pkg_malloc (end - start);		(*format).port.len = end - start;		memcpy ((*format).port.s, start, end - start);		fprintf (stdout, "port=%.*s\n", (*format).port.len,			 (*format).port.s);	}	if (uri.len - len > 0) start = end + 1;	/* now start is after * */	len = (start - string);	/* protocol */	end = q_memchr (start, '@', uri.len - len);	/* ...*udp@PUBLIC */	if (end == NULL)	/* should not be , wrong encoding or */	{		foo = -8;		goto error1;	}	if ((end - start) != 0)	{		(*format).protocol.s = pkg_malloc (end - start);		(*format).protocol.len = end - start;		memcpy ((*format).protocol.s, start, end - start);		start = end + 1;	/* now start is after @ */		fprintf (stdout, "protocol=%.*s\n", (*format).protocol.len,			 (*format).protocol.s);	}	if (uri.len - len > 0) start = end + 1;	/* now start is after * looking for end */	len = (start - string);	end = q_memchr (start, '>', uri.len - len);	pos = q_memchr (start, ';', uri.len - len);	if ((end == NULL) && (pos == NULL))		end = string + uri.len;	else if (pos == NULL) ;	else if (end == NULL)		end = pos;	(*format).second = end - string;	return 0;error1:		free_uri_format (*format);	return foo;}