MFC: rev. 1.110
---------------------------------------------------------------------------- Instead of manually freeing the packet options structure (and not even doing a good job of it) in the copypktopts() function, just call ip6_clearpktopts() directly. Otherwise, the callers of this function would end up freeing the memory twice. Reviewed by: jinmei PR: kern/116360 ----------------------------------------------------------------------------
This commit is contained in:
parent
d61e36b8ea
commit
c661fd79dc
@ -2528,12 +2528,7 @@ copypktopts(dst, src, canwait)
|
||||
return (0);
|
||||
|
||||
bad:
|
||||
if (dst->ip6po_pktinfo) free(dst->ip6po_pktinfo, M_IP6OPT);
|
||||
if (dst->ip6po_nexthop) free(dst->ip6po_nexthop, M_IP6OPT);
|
||||
if (dst->ip6po_hbh) free(dst->ip6po_hbh, M_IP6OPT);
|
||||
if (dst->ip6po_dest1) free(dst->ip6po_dest1, M_IP6OPT);
|
||||
if (dst->ip6po_dest2) free(dst->ip6po_dest2, M_IP6OPT);
|
||||
if (dst->ip6po_rthdr) free(dst->ip6po_rthdr, M_IP6OPT);
|
||||
ip6_clearpktopts(dst, -1);
|
||||
return (ENOBUFS);
|
||||
}
|
||||
#undef PKTOPT_EXTHDRCPY
|
||||
|
Loading…
x
Reference in New Issue
Block a user