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:
committed by
Stephen Hemminger
parent
29878128d8
commit
5682cf3ac6
@@ -153,6 +153,7 @@ static int mst_show(int argc, char **argv)
|
|||||||
|
|
||||||
if (rtnl_dump_filter(&rth, print_msts, stdout) < 0) {
|
if (rtnl_dump_filter(&rth, print_msts, stdout) < 0) {
|
||||||
fprintf(stderr, "Dump terminated\n");
|
fprintf(stderr, "Dump terminated\n");
|
||||||
|
delete_json_obj();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user