mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 05:55:28 +00:00
[2377] Make the construction exception safe
This commit is contained in:
@@ -21,8 +21,10 @@
|
||||
#include <dns/rdata.h>
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
using std::string;
|
||||
using std::auto_ptr;
|
||||
|
||||
namespace isc {
|
||||
namespace dns {
|
||||
@@ -236,9 +238,12 @@ MasterLoader::MasterLoader(std::istream& stream,
|
||||
if (add_callback.empty()) {
|
||||
isc_throw(isc::InvalidParameter, "Empty add RR callback");
|
||||
}
|
||||
impl_ = new MasterLoaderImpl("", zone_origin, zone_class, callbacks,
|
||||
add_callback, options);
|
||||
impl_->pushStreamSource(stream);
|
||||
auto_ptr<MasterLoaderImpl> impl(new MasterLoaderImpl("", zone_origin,
|
||||
zone_class, callbacks,
|
||||
add_callback,
|
||||
options));
|
||||
impl->pushStreamSource(stream);
|
||||
impl_ = impl.release();
|
||||
}
|
||||
|
||||
MasterLoader::~MasterLoader() {
|
||||
|
Reference in New Issue
Block a user