rem: if (format.username.len > 0) pkg_free (format.username.s); if (format.password.len > 0) pkg_free (format.password.s); if (format.ip.len > 0) pkg_free (format.ip.s); if (format.port.len > 0) pkg_free (format.port.s); if (format.protocol.len > 0) pkg_free (format.protocol.s);
add: if (format->username.len > 0) {printf("1 \n");pkg_free (format->username.s); } if (format->password.len > 0) {printf("2 \n");pkg_free (format->password.s);} if (format->ip.len > 0) {printf("3 \n");pkg_free (format->ip.s);} if (format->port.len > 0) {printf("4 \n");pkg_free (format->port.s);} if (format->protocol.len > 0) {printf("5 \n");pkg_free (format->protocol.s);} memset(format,0,sizeof(struct uri_format));
context: free_uri_format (struct uri_format format){	printf("Start of Dealocating format \n");	if (format.username.len > 0)		pkg_free (format.username.s);	if (format.password.len > 0)		pkg_free (format.password.s);	if (format.ip.len > 0)		pkg_free (format.ip.s);	if (format.port.len > 0)		pkg_free (format.port.s);	if (format.protocol.len > 0)		pkg_free (format.protocol.s);	printf("End of Dealocating format \n");fflush(stdout);	return 0;}