HomeFreeBSD

Fix mbuf leaks in various pru_send implementations

Description

Fix mbuf leaks in various pru_send implementations

The various protocol implementations are not very consistent about
freeing mbufs in error paths. In general, all protocols must free both
"m" and "control" upon an error, except if PRUS_NOTREADY is specified
(this is only implemented by TCP and unix(4) and requires further work
not handled in this diff), in which case "control" still must be freed.

This diff plugs various leaks in the pru_send implementations.

Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D30151

Details

Provenance
markjAuthored on May 12 2021, 1:39 PM
Reviewer
tuexen
Differential Revision
D30151: Fix mbuf leaks in various pru_send implementations
Parents
rGc1dd4d642fa0: nd6: Avoid using an uninitialized sockaddr in nd6_prefix_offlink()
Branches
Unknown
Tags
Unknown