From c47eb8b3709346028c4470e7c02929db5360498c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= <rafael.carre@savoirfairelinux.com> Date: Tue, 26 Jul 2011 15:24:05 -0400 Subject: [PATCH] YamlParserException : fix use of stack variable after it has been deallocated --- sflphone-common/src/config/yamlparser.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sflphone-common/src/config/yamlparser.h b/sflphone-common/src/config/yamlparser.h index 87926dbed6..2061d7e99f 100644 --- a/sflphone-common/src/config/yamlparser.h +++ b/sflphone-common/src/config/yamlparser.h @@ -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; -- GitLab