As ip_insertoptions() may prepend a mbuf, "goto bad" has to free
authorbluhm <bluhm@openbsd.org>
Tue, 23 Feb 2021 12:14:10 +0000 (12:14 +0000)
committerbluhm <bluhm@openbsd.org>
Tue, 23 Feb 2021 12:14:10 +0000 (12:14 +0000)
commit77dfdc871d4cc806522f434a4d2465decc752610
tree446c19a2c85e88b5f1e26803feec75041f326f55
parent3da63063d2342371cd7c6e969124b8066dc1b6c3
As ip_insertoptions() may prepend a mbuf, "goto bad" has to free
the new chain.  This fixes a potential memory leak in ip_output().
Also simplify a bunch of "goto done".
OK kn@ mvs@
sys/netinet/ip_output.c