From: Otto Date: Mon, 11 Jan 2021 08:55:08 +0000 (+0100) Subject: Resource not released in destructor X-Git-Tag: rec-4.5.0-alpha1~20^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd27dc73dfa8448ae8893b235188235e8f56ad85;p=thirdparty%2Fpdns.git Resource not released in destructor --- 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);