Remove an unused variable from DropRateErrorModel.
Dynamically allocate new_p in QuicPacket::ReassemblePacket.
The latter fixes several of these warnings during the ns-3 compilation:
#18 80.41 [985/1050] Building CXX object scratch/CMakeFiles/scratch_blackhole_blackhole.dir/helper/quic-packet.cc.o
#18 80.41 In file included from /ns3/src/core/model/simple-ref-count.h:25,
#18 80.41 from /ns3/src/core/model/attribute.h:23,
#18 80.41 from /ns3/src/core/model/attribute-accessor-helper.h:22,
#18 80.41 from /ns3/src/core/model/attribute-helper.h:23,
#18 80.41 from /ns3/src/core/model/callback.h:24,
#18 80.41 from /ns3/src/core/model/object-base.h:22,
#18 80.41 from /ns3/out/include/ns3/object-base.h:1,
#18 80.41 from /ns3/src/network/model/chunk.h:25,
#18 80.41 from /ns3/src/network/model/header.h:24,
#18 80.41 from /ns3/out/include/ns3/header.h:1,
#18 80.41 from /ns3/scratch/helper/quic-packet.h:6,
#18 80.41 from /ns3/scratch/helper/quic-packet.cc:4:
#18 80.41 In static member function ‘static void ns3::DefaultDeleter<T>::Delete(T*) [with T = ns3::Packet]’,
#18 80.41 inlined from ‘void ns3::SimpleRefCount<T, PARENT, DELETER>::Unref() const [with T = ns3::Packet; PARENT = ns3::Empty; DELETER = ns3::DefaultDeleter<ns3::Packet>]’ at /ns3/src/core/model/simple-ref-count.h:131:28,
#18 80.41 inlined from ‘ns3::Ptr<T>::~Ptr() [with T = ns3::Packet]’ at /ns3/src/core/model/ptr.h:693:21,
#18 80.41 inlined from ‘void QuicPacket::ReassemblePacket()’ at /ns3/scratch/helper/quic-packet.cc:84:18:
#18 80.41 /ns3/src/core/model/default-deleter.h:55:9: warning: ‘void operator delete(void*, std::size_t)’ called on unallocated object ‘new_p’ [-Wfree-nonheap-object]
#18 80.41 55 | delete object;
#18 80.41 | ^~~~~~~~~~~~~
#18 80.41 /ns3/scratch/helper/quic-packet.cc: In member function ‘void QuicPacket::ReassemblePacket()’:
#18 80.41 /ns3/scratch/helper/quic-packet.cc:72:12: note: declared here
#18 80.41 72 | Packet new_p = Packet(udp_payload_.data(), udp_payload_.size());
#18 80.41 | ^~~~~
ENV
syntax in the Dockerfile.DropRateErrorModel
.new_p
inQuicPacket::ReassemblePacket
.The latter fixes several of these warnings during the ns-3 compilation: