struct{
char *p;
...
}test;

t.p=malloc(....)
...
func(t);
...

func(struct test t)
{
free(t.p);
}

こういう場合はポインタ渡しでなくてもで解放される。