Is this method to a String from a function going to cause memory corruption?
You are better off passing the string by reference, like this:

bool getStringOrTimeout(String &amp; s)
{
  if (timed_out)
    return false;
  s = "foo";
  return true;

}


That means the caller's string will be modified. And you no longer need to pass down a pointer to a string.