Check if devops is valid before closing the device.
This fixes a segfault that occurs on exit if tinc fails before the device is initialized (for example, if it fails to read the private key).
This commit is contained in:
parent
45a30f7157
commit
b12f122f1b
1 changed files with 2 additions and 1 deletions
|
@ -1141,7 +1141,8 @@ void close_network_connections(void) {
|
|||
|
||||
if (device_fd >= 0)
|
||||
io_del(&device_io);
|
||||
devops.close();
|
||||
if (devops.close)
|
||||
devops.close();
|
||||
|
||||
exit_control();
|
||||
|
||||
|
|
Loading…
Reference in a new issue