mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +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 )
|
proto != IPPROTO_ICMP )
|
||||||
{
|
{
|
||||||
dump_this_packet = 1;
|
dump_this_packet = 1;
|
||||||
|
if ( f )
|
||||||
|
Remove(t);
|
||||||
delete_tunnel_info(tunnel_info);
|
delete_tunnel_info(tunnel_info);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -516,6 +518,8 @@ void NetSessions::DoNextPacket(double t, const struct pcap_pkthdr* hdr,
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Weird(fmt("unknown_protocol %d", proto), hdr, pkt);
|
Weird(fmt("unknown_protocol %d", proto), hdr, pkt);
|
||||||
|
if ( f )
|
||||||
|
Remove(f);
|
||||||
delete_tunnel_info(tunnel_info);
|
delete_tunnel_info(tunnel_info);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -546,6 +550,8 @@ void NetSessions::DoNextPacket(double t, const struct pcap_pkthdr* hdr,
|
||||||
if ( consistent < 0 )
|
if ( consistent < 0 )
|
||||||
{
|
{
|
||||||
delete h;
|
delete h;
|
||||||
|
if ( f )
|
||||||
|
Remove(f);
|
||||||
delete_tunnel_info(tunnel_info);
|
delete_tunnel_info(tunnel_info);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -571,6 +577,8 @@ void NetSessions::DoNextPacket(double t, const struct pcap_pkthdr* hdr,
|
||||||
if ( ! conn )
|
if ( ! conn )
|
||||||
{
|
{
|
||||||
delete_tunnel_info(tunnel_info);
|
delete_tunnel_info(tunnel_info);
|
||||||
|
if ( f )
|
||||||
|
Remove(f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ TunnelHandler::TunnelHandler(NetSessions *arg_s)
|
||||||
// lookup.
|
// lookup.
|
||||||
for (int i=0; i< 65536; i++)
|
for (int i=0; i< 65536; i++)
|
||||||
{
|
{
|
||||||
Unref(pv);
|
if (pv)
|
||||||
|
Unref(pv);
|
||||||
pv = new PortVal(i, TRANSPORT_UDP);
|
pv = new PortVal(i, TRANSPORT_UDP);
|
||||||
if (udp_tunnel_ports->Lookup(pv, false))
|
if (udp_tunnel_ports->Lookup(pv, false))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue