[Boost-bugs] [Boost C++ Libraries] #4151: option_description::option_description(3 params) is exception-unsafe

Subject: [Boost-bugs] [Boost C++ Libraries] #4151: option_description::option_description(3 params) is exception-unsafe
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-04-26 06:01:10


#4151: option_description::option_description(3 params) is exception-unsafe
--------------------------+-------------------------------------------------
 Reporter: anonymous | Owner: vladimir_prus
     Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: program_options
  Version: Boost 1.42.0 | Severity: Problem
 Keywords: |
--------------------------+-------------------------------------------------
 Given the code in libs/program_options/src/options_description.cpp:


 {{{
 option_description::
 option_description(const char* name,
                    const value_semantic* s,
                    const char* description)
 : m_description(description), m_value_semantic(s)
 {
     this->set_name(name);
 }
 }}}

 s leaks in case if initialization of m_description throws.

 The simplest cure is to make option::description::m_value_semantic member
 to be before all other members.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4151>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC