mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Minor fixes for possible leaks on uncommon code path or on initialization.
This commit is contained in:
parent
4214d8d905
commit
f3a92ec30b
2 changed files with 10 additions and 1 deletions
|
@ -444,6 +444,8 @@ void NetSessions::DoNextPacket(double t, const struct pcap_pkthdr* hdr,
|
|||
proto != IPPROTO_ICMP )
|
||||
{
|
||||
dump_this_packet = 1;
|
||||
if ( f )
|
||||
Remove(t);
|
||||
delete_tunnel_info(tunnel_info);
|
||||
return;
|
||||
}
|
||||
|
@ -516,6 +518,8 @@ void NetSessions::DoNextPacket(double t, const struct pcap_pkthdr* hdr,
|
|||
|
||||
default:
|
||||
Weird(fmt("unknown_protocol %d", proto), hdr, pkt);
|
||||
if ( f )
|
||||
Remove(f);
|
||||
delete_tunnel_info(tunnel_info);
|
||||
return;
|
||||
}
|
||||
|
@ -546,6 +550,8 @@ void NetSessions::DoNextPacket(double t, const struct pcap_pkthdr* hdr,
|
|||
if ( consistent < 0 )
|
||||
{
|
||||
delete h;
|
||||
if ( f )
|
||||
Remove(f);
|
||||
delete_tunnel_info(tunnel_info);
|
||||
return;
|
||||
}
|
||||
|
@ -571,6 +577,8 @@ void NetSessions::DoNextPacket(double t, const struct pcap_pkthdr* hdr,
|
|||
if ( ! conn )
|
||||
{
|
||||
delete_tunnel_info(tunnel_info);
|
||||
if ( f )
|
||||
Remove(f);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,8 @@ TunnelHandler::TunnelHandler(NetSessions *arg_s)
|
|||
// lookup.
|
||||
for (int i=0; i< 65536; i++)
|
||||
{
|
||||
Unref(pv);
|
||||
if (pv)
|
||||
Unref(pv);
|
||||
pv = new PortVal(i, TRANSPORT_UDP);
|
||||
if (udp_tunnel_ports->Lookup(pv, false))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue