aboutsummaryrefslogtreecommitdiff
path: root/sys/net/route/route_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/route/route_ctl.c')
-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);
}