diff --git a/sys/netlink/netlink_snl_route_parsers.h b/sys/netlink/netlink_snl_route_parsers.h index ba9ead461c80..1d6680cb5597 100644 --- a/sys/netlink/netlink_snl_route_parsers.h +++ b/sys/netlink/netlink_snl_route_parsers.h @@ -82,6 +82,8 @@ nlattr_get_multipath(struct snl_state *ss, struct nlattr *nla, const void *arg _ size_t sz = (max_nhops + 2) * sizeof(struct rta_mpath_nh); struct rta_mpath *mp = snl_allocz(ss, sz); + if (mp == NULL) + return (false); mp->num_nhops = 0; for (rtnh = (struct rtnexthop *)(void *)(nla + 1); data_len > 0; ) {