|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65228 - trunk/libs/exception/src
From: emil_at_[hidden]
Date: 2010-09-03 20:43:25
Author: emildotchevski
Date: 2010-09-03 20:43:24 EDT (Fri, 03 Sep 2010)
New Revision: 65228
URL: http://svn.boost.org/trac/boost/changeset/65228
Log:
fixing obscure, extremely rare double- free() bug in clone_current_exception_msvc.cpp
Text files modified:
trunk/libs/exception/src/clone_current_exception_msvc.cpp | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
Modified: trunk/libs/exception/src/clone_current_exception_msvc.cpp
==============================================================================
--- trunk/libs/exception/src/clone_current_exception_msvc.cpp (original)
+++ trunk/libs/exception/src/clone_current_exception_msvc.cpp 2010-09-03 20:43:24 EDT (Fri, 03 Sep 2010)
@@ -157,10 +157,10 @@
assert(src!=0);
cpp_type_info const & ti=get_cpp_type_info(et);
if( void * dst = malloc(ti.size) )
+ {
try
{
copy_msvc_exception(dst,src,ti);
- return boost::shared_ptr<void>(dst,exception_object_deleter(et));
}
catch(
... )
@@ -168,6 +168,8 @@
free(dst);
throw;
}
+ return boost::shared_ptr<void>(dst,exception_object_deleter(et));
+ }
else
throw std::bad_alloc();
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk