mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-14 10:56:59 +08:00
ensure that in all cases the tun fd is closed
This commit is contained in:
@@ -128,11 +128,9 @@ int handle_script_exit(main_server_st *s, struct proc_st *proc, int code)
|
||||
* The parent doesn't need to keep the tunfd, and if it does,
|
||||
* it causes issues to client.
|
||||
*/
|
||||
if (proc->tun_lease.name[0] != 0) {
|
||||
if (proc->tun_lease.fd >= 0)
|
||||
close(proc->tun_lease.fd);
|
||||
proc->tun_lease.fd = -1;
|
||||
}
|
||||
if (proc->tun_lease.fd >= 0)
|
||||
close(proc->tun_lease.fd);
|
||||
proc->tun_lease.fd = -1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user