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