Skip to content
Snippets Groups Projects
Commit c47eb8b3 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

YamlParserException : fix use of stack variable after it has been deallocated

parent 56024357
Branches
Tags
No related merge requests found
......@@ -48,15 +48,12 @@ typedef std::vector<yaml_event_t> YamlEventVector;
class YamlParserException : public std::exception
{
public:
YamlParserException (const std::string& str="") throw() : errstr (str) {}
YamlParserException (const std::string& str="") : errstr ("YamlParserException occured: " + str) {}
virtual ~YamlParserException() throw() {}
virtual const char *what() const throw() {
std::string expt ("YamlParserException occured: ");
expt.append (errstr);
return expt.c_str();
return errstr.c_str();
}
private:
std::string errstr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment