[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <385b4ead-8d43-4845-ac66-4218b285be32@blackwall.org>
Date: Mon, 25 Nov 2024 11:19:47 +0200
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Minhong He <heminhong@...inos.cn>, stephen@...workplumber.org,
netdev@...r.kernel.org
Subject: Re: [PATCH] bridge: fix memory leak in error path
On 25/11/2024 09:31, Minhong He wrote:
> When 'rtnl_dump_filter()' fails to process, it will cause memory leak.
>
> Signed-off-by: Minhong He <heminhong@...inos.cn>
> ---
> bridge/mst.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Please CC bridge maintainers on related patches. This is a patch for iproute2
and should have it in the subject (e.g. PATCH iproute2). Also there's undocumented
and unrelated cosmetic fix (removal of extra tab below).
> diff --git a/bridge/mst.c b/bridge/mst.c
> index 32f64aba..a85e6188 100644
> --- a/bridge/mst.c
> +++ b/bridge/mst.c
> @@ -153,6 +153,7 @@ static int mst_show(int argc, char **argv)
>
> if (rtnl_dump_filter(&rth, print_msts, stdout) < 0) {
> fprintf(stderr, "Dump terminated\n");
> + delete_json_obj();
> return -1;
> }
>
> @@ -214,7 +215,7 @@ static int mst_set(int argc, char **argv)
> state = strtol(s, &endptr, 10);
> if (!(*s != '\0' && *endptr == '\0'))
> state = parse_stp_state(s);
> -
> +
This change is not documented and unrelated cosmetic fix.
> if (state < 0 || state > UINT8_MAX) {
> fprintf(stderr, "Error: invalid STP port state\n");
> return -1;
Powered by blists - more mailing lists