|
@@ -772,7 +772,7 @@ static struct in_ifaddr *rtm_to_ifaddr(struct net *net, struct nlmsghdr *nlh,
|
|
|
ci = nla_data(tb[IFA_CACHEINFO]);
|
|
|
if (!ci->ifa_valid || ci->ifa_prefered > ci->ifa_valid) {
|
|
|
err = -EINVAL;
|
|
|
- goto errout;
|
|
|
+ goto errout_free;
|
|
|
}
|
|
|
*pvalid_lft = ci->ifa_valid;
|
|
|
*pprefered_lft = ci->ifa_prefered;
|
|
@@ -780,6 +780,8 @@ static struct in_ifaddr *rtm_to_ifaddr(struct net *net, struct nlmsghdr *nlh,
|
|
|
|
|
|
return ifa;
|
|
|
|
|
|
+errout_free:
|
|
|
+ inet_free_ifa(ifa);
|
|
|
errout:
|
|
|
return ERR_PTR(err);
|
|
|
}
|