majintao0131 / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Possible runtime error in YAML::Exception::what() #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
    virtual const char *what() const throw() {
      std::stringstream output;
      output << "Error at line " << line+1 << ", column " << column+1 << ":
" << msg;
      return output.str().c_str();
    }

returns a pointer to the peace of memory which will be deallocated after
deleting temporary object 'output'.

Original issue reported on code.google.com by Vasily.S...@gmail.com on 25 Jul 2009 at 7:18

GoogleCodeExporter commented 9 years ago
You're right; I changed it to just keep a string with the what() message.

Original comment by jbe...@gmail.com on 26 Jul 2009 at 1:38