]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
bridge: fix memory leak in error path
authorMinhong He <heminhong@kylinos.cn>
Tue, 26 Nov 2024 02:18:19 +0000 (10:18 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 2 Dec 2024 19:17:01 +0000 (11:17 -0800)
The 'json' object doesn't free when 'rtnl_dump_filter()' fails to process,
fix it.

Signed-off-by: Minhong He <heminhong@kylinos.cn>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
bridge/mst.c

index 32f64aba98e8f170460e0eb2eccc8d59fbe57986..37362c45e9423e49da239d11d729f939cb8cdc0e 100644 (file)
@@ -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;
        }