]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip: netns: fix missing netns close on some error paths
authorAndrea Claudi <aclaudi@redhat.com>
Mon, 19 Apr 2021 13:37:25 +0000 (15:37 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 27 Apr 2021 04:04:02 +0000 (21:04 -0700)
commit38ef5bb7b4a7e8b191f4087c140a07a0779fa903
treed097d015697f522e1063848a27ae63d8b4e9a670
parentb5a6ed9cc9fc15df13d07fe6b2dcc58942d89a2a
ip: netns: fix missing netns close on some error paths

In functions netns_pids() and netns_identify_pid(), the netns file is
not closed on some error paths.

Fix this using a conditional close and a single return point on both
functions.

Fixes: 44b563269ea1 ("ip-nexthop: support flush by id")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipnetns.c