Fix multicast double free issue in IPv4.

- IPv4 had the same problem as v6. Most likely this was an oversight
  when converting from a C to a C++ module. Might help with #6736 and
  #8894.
This commit is contained in:
Rene Gollent 2012-08-19 11:09:06 -04:00
parent 9db38fdf34
commit ad4d57f14b
2 changed files with 8 additions and 2 deletions

View File

@ -163,10 +163,16 @@ struct MulticastStateHash {
struct ipv4_protocol : net_protocol { struct ipv4_protocol : net_protocol {
ipv4_protocol() ipv4_protocol()
: :
raw(NULL),
multicast_filter(this) multicast_filter(this)
{ {
} }
~ipv4_protocol()
{
delete raw;
}
RawSocket* raw; RawSocket* raw;
uint8 service_type; uint8 service_type;
uint8 time_to_live; uint8 time_to_live;
@ -1029,9 +1035,8 @@ ipv4_uninit_protocol(net_protocol* _protocol)
{ {
ipv4_protocol* protocol = (ipv4_protocol*)_protocol; ipv4_protocol* protocol = (ipv4_protocol*)_protocol;
delete protocol->raw;
delete protocol->multicast_address;
delete protocol; delete protocol;
return B_OK; return B_OK;
} }

View File

@ -180,6 +180,7 @@ struct MulticastStateHash {
struct ipv6_protocol : net_protocol { struct ipv6_protocol : net_protocol {
ipv6_protocol() ipv6_protocol()
: :
raw(NULL),
multicast_filter(this) multicast_filter(this)
{ {
} }