mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Use shared_ptr for encapsulation data instead of raw pointer
This commit is contained in:
parent
a7d4364334
commit
41dcd0cde0
16 changed files with 103 additions and 115 deletions
|
@ -62,8 +62,7 @@ void Packet::Init(int arg_link_type, pkt_timeval *arg_ts, uint32_t arg_caplen,
|
|||
l3_proto = L3_UNKNOWN;
|
||||
l3_checksummed = false;
|
||||
|
||||
delete encap;
|
||||
encap = nullptr;
|
||||
encap.reset();
|
||||
delete ip_hdr;
|
||||
ip_hdr = nullptr;
|
||||
|
||||
|
@ -93,7 +92,7 @@ const IP_Hdr Packet::IP() const
|
|||
return IP_Hdr((struct ip *) (data + hdr_size), false);
|
||||
}
|
||||
|
||||
void Packet::Weird(const char* name, const EncapsulationStack* encap)
|
||||
void Packet::Weird(const char* name, const std::shared_ptr<EncapsulationStack>& encap)
|
||||
{
|
||||
sessions->Weird(name, this, encap);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue