func A(struct A a){
....
a->any = malloc()
}

func B(){
struct A a;
funcA(&a);
}

この関数Aの中のmallocで確保した領域は
funcBに戻った時点で未定義ですよね?