From: Etienne Dechamps Date: Sat, 12 Jul 2014 12:56:01 +0000 (+0100) Subject: Check if devops is valid before closing the device. X-Git-Tag: release-1.1pre11~60^2 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=b12f122f1be89b49d8a3e39fb1b10c6e4d3ada94;p=tinc 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). --- diff --git a/src/net_setup.c b/src/net_setup.c index 96a72247..d83c5723 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -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();