From dd27dc73dfa8448ae8893b235188235e8f56ad85 Mon Sep 17 00:00:00 2001 From: Otto Date: Mon, 11 Jan 2021 09:55:08 +0100 Subject: [PATCH] Resource not released in destructor --- pdns/dnsbulktest.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsbulktest.cc b/pdns/dnsbulktest.cc index 8f8cd8b690..6d6644519f 100644 --- a/pdns/dnsbulktest.cc +++ b/pdns/dnsbulktest.cc @@ -81,13 +81,13 @@ struct SendReceive boost::accumulators::tag::mean(immediate) > > acc_t; - acc_t* d_acc; + unique_ptr d_acc; boost::array d_probs; SendReceive(const std::string& remoteAddr, uint16_t port) : d_probs({{0.001,0.01, 0.025, 0.1, 0.25,0.5,0.75,0.9,0.975, 0.99,0.9999}}) { - d_acc = new acc_t(boost::accumulators::tag::extended_p_square::probabilities=d_probs); + d_acc = make_unique(acc_t(boost::accumulators::tag::extended_p_square::probabilities=d_probs)); // //d_acc = acc_t d_socket = socket(AF_INET, SOCK_DGRAM, 0); -- 2.47.2