diff --git a/sflphone-common/src/config/yamlparser.h b/sflphone-common/src/config/yamlparser.h
index 87926dbed6c42363e7bc1a1b68b78f3e07e062a7..2061d7e99f3f4fd4e91c392161c0e8797ee9d7dc 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;