You returned a temporary copy of your vector. After the statement it is part of it is destroyed. If you wanted to keep it around you need to assign it to another vector.
So, you made a pointer to a temporary value which got erased. It no longer exists, and you're trying to point to pieces of its corpse.