Index | Thread | Search

From:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Subject:
Re: bgpctl: plug "leak" in mrt_aspath_inflate()
To:
Theo Buehler <tb@theobuehler.org>
Cc:
tech@openbsd.org
Date:
Mon, 3 Nov 2025 11:43:45 +0100

Download raw body.

Thread
On Mon, Nov 03, 2025 at 11:28:41AM +0100, Theo Buehler wrote:
> This is mostly cosmetics, as the error is impossible to hit.
> 
> CID 492358

OK claudio@
 
> Index: mrtparser.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpctl/mrtparser.c,v
> diff -u -p -u -4 -r1.22 mrtparser.c
> --- mrtparser.c	1 Feb 2024 11:37:10 -0000	1.22
> +++ mrtparser.c	3 Nov 2025 10:23:04 -0000
> @@ -823,8 +823,9 @@ mrt_aspath_inflate(struct ibuf *buf, uin
>  	if ((data = malloc(len)) == NULL)
>  		err(1, "malloc");
>  	if (ibuf_get(asbuf, data, len) == -1) {
>  		ibuf_free(asbuf);
> +		free(data);
>  		return (NULL);
>  	}
>  	ibuf_free(asbuf);
>  	*newlen = len;
> 

-- 
:wq Claudio