Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Feb 2021 20:41:17 GMT
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org
Subject:   git: 2f4f3e251245 - releng/13.0 - Fix ifa refcount leak during route addition.
Message-ID:  <202102152041.11FKfHxv089493@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch releng/13.0 has been updated by melifaro:

URL: https://cgit.FreeBSD.org/src/commit/?id=2f4f3e25124574ea041ae06240633597bc0f82c6

commit 2f4f3e25124574ea041ae06240633597bc0f82c6
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2021-02-15 20:39:33 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2021-02-15 20:41:05 +0000

    Fix ifa refcount leak during route addition.
    
    Reported by:    rstone
    Reviewed by:    rstone
    Approved by:    re(gjb)
    
    (cherry picked from commit 11304949deb36d2f9abbcda87d398496e892dcec)
---
 sys/net/route/route_ctl.c | 6 ++----
 1 file 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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102152041.11FKfHxv089493>