diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 04a964cf40cc..cb175d07c4d2 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1604,8 +1604,6 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, ("%s: bucket unexpectedly unlocked", __func__)); SCH_UNLOCK(sch); - if (ipopts) - (void)m_free(ipopts); goto done; } } @@ -1775,6 +1773,8 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, #ifdef MAC mac_syncache_destroy(&maclabel); #endif + if (ipopts) + (void)m_free(ipopts); } return (rv); }