bridge: fix memory leak in error path

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>
This commit is contained in:
Minhong He
2024-11-26 10:18:19 +08:00
committed by Stephen Hemminger
parent 29878128d8
commit 5682cf3ac6

View 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;
}