Martin Pieuchot [mpieuc...@nolizard.org] wrote: > > @@ -653,12 +653,12 @@ ifa_ifwithroute(int flags, struct sockad > struct rtentry *rt = rtalloc(gateway, 0, rtableid); > if (rt == NULL) > return (NULL); > - rt->rt_refcnt--; > /* The gateway must be local if the same address family. */ > if ((rt->rt_flags & RTF_GATEWAY) && > rt_key(rt)->sa_family == dst->sa_family) > return (NULL);
And if ((rt->rt_flags & RTF_GATEWAY) && rt_key(rt)->sa_family == dst->sa_family) { + rtfree(rt); return (NULL); } > ifa = rt->rt_ifa; > + rtfree(rt); > if (ifa == NULL || ifa->ifa_ifp == NULL) > return (NULL);