aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2021-02-12 20:56:52 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2021-02-13 00:06:14 +0000
commita375ec52a7b423133f66878ecf002efc3b6e9fca (patch)
tree3292db3c401e04aa627b5ef941fba5edc41b3b6e /sys
parent5ae8b018321f1562cd6bc39992aa110f9a0a2586 (diff)
downloadsrc-a375ec52a7b423133f66878ecf002efc3b6e9fca.tar.gz
src-a375ec52a7b423133f66878ecf002efc3b6e9fca.zip
Fix ifa refcount leak during route addition.
Reported by: rstone Reviewed by: rstone MFC after: 1 day
Diffstat (limited to 'sys')
-rw-r--r--sys/net/route/route_ctl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c
index 6b0869196d12..9aedfb9d5855 100644
--- a/sys/net/route/route_ctl.c
+++ b/sys/net/route/route_ctl.c
@@ -594,14 +594,12 @@ create_rtentry(struct rib_head *rnh, struct rt_addrinfo *info,
}
error = nhop_create_from_info(rnh, info, &nh);
- if (error != 0) {
- ifa_free(info->rti_ifa);
+ ifa_free(info->rti_ifa);
+ if (error != 0)
return (error);
- }
rt = uma_zalloc(V_rtzone, M_NOWAIT | M_ZERO);
if (rt == NULL) {
- ifa_free(info->rti_ifa);
nhop_free(nh);
return (ENOBUFS);
}