HPMAN (./62) :
s will cease to exist when function returns. Returned value will point to a memory location on the stack that might be used by something else.
It's OK because the function returns a struct (return by value), not a pointer to a local struct (return by reference):
https://stackoverflow.com/a/9653083HPMAN (./64) :
Even if the compiler makes it work for you it's going to be allocated on the stack, it will grow on each call, and that memory will never be released.
Returning a pointer to a local struct is a bad idea, but not because of this. Stack allocations are always released when exiting a function.