mirror of https://gerrit.osmocom.org/libosmocore
tun: Fix potential unpaired call to osmo_netns_switch_exit()
Fixes: Coverity CID#307429 Change-Id: Iadfc9eb48c6342433eee8da3e4d00ee496df3c75
This commit is contained in:
parent
1466daf75d
commit
d3455fa620
|
@ -407,7 +407,8 @@ err_close_tun:
|
|||
close(tundev->wqueue.bfd.fd);
|
||||
tundev->wqueue.bfd.fd = -1;
|
||||
err_restore_ns:
|
||||
osmo_netns_switch_exit(&switch_state);
|
||||
if (tundev->netns_name)
|
||||
osmo_netns_switch_exit(&switch_state);
|
||||
err_close_netns_fd:
|
||||
if (netns_fd >= 0)
|
||||
close(netns_fd);
|
||||
|
|
Loading…
Reference in New Issue