Make device close cleaner.

This commit is contained in:
Etienne Dechamps 2014-06-22 09:53:26 +01:00 committed by Guus Sliepen
parent 6382608653
commit ed1d0878af
9 changed files with 56 additions and 37 deletions

View file

@ -213,10 +213,11 @@ static bool setup_device(void) {
}
static void close_device(void) {
CloseHandle(device_handle);
CloseHandle(device_handle); device_handle = INVALID_HANDLE_VALUE;
free(device);
free(iface);
free(device); device = NULL;
free(iface); iface = NULL;
device_info = NULL;
}
static bool read_packet(vpn_packet_t *packet) {