Avoid leak of roa in rtr_parse_ipv{4,6}_prefix()
authortb <tb@openbsd.org>
Tue, 8 Mar 2022 13:02:42 +0000 (13:02 +0000)
committertb <tb@openbsd.org>
Tue, 8 Mar 2022 13:02:42 +0000 (13:02 +0000)
commitf3760350bcb7dc879feee5d7bb98879f3e372682
tree9ab9058ca7f487dfb56a2596f25fb6172dfb79f5
parented3fccd1728194a81894abefa8648f8019d0cbe3
Avoid leak of roa in rtr_parse_ipv{4,6}_prefix()

If the length checks trigger, roa is leaked. Pull the length checks
above the allocation, which makes more sense and avoids additional
free(roa).

ok claudio
usr.sbin/bgpd/rtr_proto.c