]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Resource not released in destructor
authorOtto <otto.moerbeek@open-xchange.com>
Mon, 11 Jan 2021 08:55:08 +0000 (09:55 +0100)
committerOtto <otto.moerbeek@open-xchange.com>
Mon, 11 Jan 2021 08:55:08 +0000 (09:55 +0100)
pdns/dnsbulktest.cc

index 8f8cd8b690024372401bf29eb1aaf5e28ee9e4b6..6d6644519f7863310b70a7868efdc94b2c94f523 100644 (file)
@@ -81,13 +81,13 @@ struct SendReceive
               boost::accumulators::tag::mean(immediate)
               >
     > acc_t;
-  acc_t* d_acc;
+  unique_ptr<acc_t> d_acc;
   
   boost::array<double, 11> 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>(acc_t(boost::accumulators::tag::extended_p_square::probabilities=d_probs));
     // 
     //d_acc = acc_t
     d_socket = socket(AF_INET, SOCK_DGRAM, 0);