diff --git a/src/clone_current_exception_msvc.cpp b/src/clone_current_exception_msvc.cpp index 5a132e8..73914bc 100644 --- a/src/clone_current_exception_msvc.cpp +++ b/src/clone_current_exception_msvc.cpp @@ -157,10 +157,10 @@ namespace 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(dst,exception_object_deleter(et)); } catch( ... ) @@ -168,6 +168,8 @@ namespace free(dst); throw; } + return boost::shared_ptr(dst,exception_object_deleter(et)); + } else throw std::bad_alloc(); }