Commit 82fc64bf authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2387] Add comments on use of auto_ptr

parent e8b5540d
......@@ -72,6 +72,9 @@ struct DNSKEYImpl {
DNSKEY::DNSKEY(const std::string& dnskey_str) :
impl_(NULL)
{
// We use auto_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a
// leak of the DNSKEYImpl that constructFromLexer() returns.
std::auto_ptr<DNSKEYImpl> impl_ptr(NULL);
try {
......
......@@ -87,6 +87,9 @@ struct NSEC3Impl {
NSEC3::NSEC3(const std::string& nsec3_str) :
impl_(NULL)
{
// We use auto_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a
// leak of the NSEC3Impl that constructFromLexer() returns.
std::auto_ptr<NSEC3Impl> impl_ptr(NULL);
try {
......
......@@ -65,6 +65,9 @@ struct NSEC3PARAMImpl {
NSEC3PARAM::NSEC3PARAM(const std::string& nsec3param_str) :
impl_(NULL)
{
// We use auto_ptr here because if there is an exception in this
// constructor, the destructor is not called and there could be a
// leak of the NSEC3PARAMImpl that constructFromLexer() returns.
std::auto_ptr<NSEC3PARAMImpl> impl_ptr(NULL);
try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment