forked from boostorg/exception
fixing obscure, extremely rare double- free() bug in clone_current_exception_msvc.cpp
[SVN r65228]
This commit is contained in:
@ -157,10 +157,10 @@ namespace
|
|||||||
assert(src!=0);
|
assert(src!=0);
|
||||||
cpp_type_info const & ti=get_cpp_type_info(et);
|
cpp_type_info const & ti=get_cpp_type_info(et);
|
||||||
if( void * dst = malloc(ti.size) )
|
if( void * dst = malloc(ti.size) )
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
copy_msvc_exception(dst,src,ti);
|
copy_msvc_exception(dst,src,ti);
|
||||||
return boost::shared_ptr<void>(dst,exception_object_deleter(et));
|
|
||||||
}
|
}
|
||||||
catch(
|
catch(
|
||||||
... )
|
... )
|
||||||
@ -168,6 +168,8 @@ namespace
|
|||||||
free(dst);
|
free(dst);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
return boost::shared_ptr<void>(dst,exception_object_deleter(et));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
throw std::bad_alloc();
|
throw std::bad_alloc();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user