The branch main has been updated by kp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=38c655093c6b641a4ed4e844af95859f66844f25

commit 38c655093c6b641a4ed4e844af95859f66844f25
Author:     Kristof Provost <k...@freebsd.org>
AuthorDate: 2025-06-03 12:20:40 +0000
Commit:     Kristof Provost <k...@freebsd.org>
CommitDate: 2025-06-05 07:52:33 +0000

    route: fix rtentry double free
    
    add_route_flags() frees the rtentry on error when called with the 
RTM_F_CREATE
    flag. Don't free the rtentry a second time.
    
    Reviewed by:    ae
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D50665
---
 sys/net/route/route_ctl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c
index 5a04e9dcf6e7..d629fd1625c3 100644
--- a/sys/net/route/route_ctl.c
+++ b/sys/net/route/route_ctl.c
@@ -673,12 +673,11 @@ rib_copy_route(struct rtentry *rt, const struct 
route_nhop_data *rnd_src,
        if (error != 0) {
                IF_DEBUG_LEVEL(LOG_DEBUG2) {
                        char buf[NHOP_PRINT_BUFSIZE];
-                       rt_print_buf(rt_new, buf, sizeof(buf));
+                       rt_print_buf(rt, buf, sizeof(buf));
                        FIB_RH_LOG(LOG_DEBUG, rh_dst,
                            "Unable to add route %s: error %d", buf, error);
                }
                nhop_free(nh);
-               rt_free_immediate(rt_new);
        }
        return (error);
 }

Reply via email to