The string you're returning is an automatic variable. When you exit the function accessing this variable is impossible. According to the specs it's undefined behavior. Use malloc to allocate the string and you'll be fine.
Just don't forget to free it afterwards.