summaryrefslogtreecommitdiffhomepage
path: root/tun
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-10 20:19:11 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-10 20:19:11 +0200
commita6045ac0423472d849f7a173da1703adf3e0c51d (patch)
tree2126f0e87f532ed87112df27420796e80eb790b7 /tun
parent1c92b48415e7f68cce859b4adf95c5d1ce5df9e9 (diff)
wintun: destroy devinfolist after usage
Diffstat (limited to 'tun')
-rw-r--r--tun/wintun/wintun_windows.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/tun/wintun/wintun_windows.go b/tun/wintun/wintun_windows.go
index 7327f98..958a309 100644
--- a/tun/wintun/wintun_windows.go
+++ b/tun/wintun/wintun_windows.go
@@ -190,6 +190,7 @@ func CreateInterface(description string, hwndParent uintptr) (*Wintun, bool, err
if err != nil {
return nil, false, fmt.Errorf("SetupDiCreateDeviceInfoListEx(%s) failed: %v", guid.ToString(&deviceClassNetGUID), err)
}
+ defer devInfoList.Close()
// Get the device class name from GUID.
className, err := setupapi.SetupDiClassNameFromGuidEx(&deviceClassNetGUID, machineName)