fixing obscure, extremely rare double- free() bug in clone_current_exception_msvc.cpp

[SVN r65228]
This commit is contained in:
Emil Dotchevski
2010-09-04 00:43:24 +00:00
parent d637e8efc7
commit 976e89a137

View File

@ -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<void>(dst,exception_object_deleter(et));
}
catch(
... )
@ -168,6 +168,8 @@ namespace
free(dst);
throw;
}
return boost::shared_ptr<void>(dst,exception_object_deleter(et));
}
else
throw std::bad_alloc();
}