From: sashan Date: Tue, 7 Jun 2022 22:18:34 +0000 (+0000) Subject: fixes potential memory leak. if_vinput() should always consume packet X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4ffa687bceed12b4c7163310fb0390320ac48e3b;p=openbsd fixes potential memory leak. if_vinput() should always consume packet by either passing it further or releasing it. OK mvs@ --- diff --git a/sys/net/if.c b/sys/net/if.c index f354c9d8a6c..58af5730cde 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.652 2022/05/03 11:47:03 bluhm Exp $ */ +/* $OpenBSD: if.c,v 1.653 2022/06/07 22:18:34 sashan Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -869,6 +869,8 @@ if_vinput(struct ifnet *ifp, struct mbuf *m) if (__predict_true(!ISSET(ifp->if_xflags, IFXF_MONITOR))) (*ifp->if_input)(ifp, m); + else + m_freem(m); } void