Fix NULL pointer dereference.

ro pointer can be NULL when IPSec consumes mbuf.

PR:		211486
MFC after:	3 days
This commit is contained in:
Andrey V. Elsukov 2016-08-02 12:18:06 +00:00
parent 05cde7efa6
commit 723758b7ce

View File

@ -1058,7 +1058,8 @@ done:
* Release the route if using our private route, or if
* (with flowtable) we don't have our own reference.
*/
if (ro == &ip6route || ro->ro_flags & RT_NORTREF)
if (ro == &ip6route ||
(ro != NULL && ro->ro_flags & RT_NORTREF))
RO_RTFREE(ro);
return (error);