Hi tech,
Dear claudio,

ctx might leak due to a prefix/rib dump new/subtree failing in calloc
and then going to nomem in rde_dump_ctx_new.

I am wondering if a similar fix is missing in rde_dump_done after
the nomem label.

thoughts?
mbuhl

Found by CodeChecker.

Index: usr.sbin/bgpd/rde.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
retrieving revision 1.578
diff -u -p -r1.578 rde.c
--- usr.sbin/bgpd/rde.c 23 Sep 2022 15:49:20 -0000      1.578
+++ usr.sbin/bgpd/rde.c 7 Nov 2022 19:17:16 -0000
@@ -2739,6 +2739,7 @@ rde_dump_ctx_new(struct ctl_show_rib_req
                error = CTL_RES_NOMEM;
                imsg_compose(ibuf_se_ctl, IMSG_CTL_RESULT, 0, pid, -1, &error,
                    sizeof(error));
+               free(ctx);
                return;
        }
 

Reply via email to