It's dangerous to return a pointer point to temporary variable(std::string val).