For example:
void func1(){ int i = 123; func2(&i); } void func2(int *a){ *a = 456; }
When func1 calling
func1
Yes, your code is safe.
As long as the object's lifetime is not over, it's safe to pass local variables like you do.