Module Name:    src
Committed By:   ozaki-r
Date:           Mon Mar 11 03:00:41 UTC 2019

Modified Files:
        src/sys/net: route.c

Log Message:
Add missing ifa_release on error paths


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/net/route.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/route.c
diff -u src/sys/net/route.c:1.216 src/sys/net/route.c:1.217
--- src/sys/net/route.c:1.216	Tue Oct 30 05:56:02 2018
+++ src/sys/net/route.c	Mon Mar 11 03:00:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.216 2018/10/30 05:56:02 ozaki-r Exp $	*/
+/*	$NetBSD: route.c,v 1.217 2019/03/11 03:00:41 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.216 2018/10/30 05:56:02 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.217 2019/03/11 03:00:41 ozaki-r Exp $");
 
 #include <sys/param.h>
 #ifdef RTFLUSH_DEBUG
@@ -1504,6 +1504,8 @@ rt_update(struct rtentry *rt, struct rt_
 		}
 		if (new_ifa == NULL)
 			ifa_release(ifa, &psref_ifa);
+		/* To avoid ifa_release below */
+		ifa = NULL;
 	}
 	ifa_release(new_ifa, &psref_new_ifa);
 	if (new_ifp && rt->rt_ifp != new_ifp && !if_is_deactivated(new_ifp)) {
@@ -1525,6 +1527,7 @@ rt_update(struct rtentry *rt, struct rt_
 	(void)ifp_changed; /* XXX gcc */
 #endif
 out:
+	ifa_release(ifa, &psref_ifa);
 	if_put(new_ifp, &psref_new_ifp);
 	if_put(ifp, &psref_ifp);
 

Reply via email to