mb_unmapped_to_ext(): fix m_free()/m_freem() use

(cherry picked from commit c5a96f09df)
This commit is contained in:
Konstantin Belousov 2025-03-06 19:36:56 +02:00
parent afec5d1968
commit eae0129ba7

View file

@ -950,7 +950,7 @@ _mb_unmapped_to_ext(struct mbuf *m, struct mbuf **mres)
if (m->m_epg_tls != NULL) {
/* can't convert TLS mbuf */
m_freem(m);
m_free(m);
*mres = NULL;
return (EINVAL);
}
@ -1098,7 +1098,7 @@ mb_unmapped_to_ext(struct mbuf *top, struct mbuf **mres)
error = _mb_unmapped_to_ext(m, &m1);
if (error != 0) {
if (top != m)
m_free(top);
m_freem(top);
m_freem(next);
*mres = NULL;
return (error);