diff --git a/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp b/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp index db79f94cb1..15011dacfa 100644 --- a/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp +++ b/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp @@ -163,10 +163,16 @@ struct MulticastStateHash { struct ipv4_protocol : net_protocol { ipv4_protocol() : + raw(NULL), multicast_filter(this) { } + ~ipv4_protocol() + { + delete raw; + } + RawSocket* raw; uint8 service_type; uint8 time_to_live; @@ -1029,9 +1035,8 @@ ipv4_uninit_protocol(net_protocol* _protocol) { ipv4_protocol* protocol = (ipv4_protocol*)_protocol; - delete protocol->raw; - delete protocol->multicast_address; delete protocol; + return B_OK; } diff --git a/src/add-ons/kernel/network/protocols/ipv6/ipv6.cpp b/src/add-ons/kernel/network/protocols/ipv6/ipv6.cpp index 68ce9b8ddb..3427a645f2 100644 --- a/src/add-ons/kernel/network/protocols/ipv6/ipv6.cpp +++ b/src/add-ons/kernel/network/protocols/ipv6/ipv6.cpp @@ -180,6 +180,7 @@ struct MulticastStateHash { struct ipv6_protocol : net_protocol { ipv6_protocol() : + raw(NULL), multicast_filter(this) { }