From a6045ac0423472d849f7a173da1703adf3e0c51d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 10 May 2019 20:19:11 +0200 Subject: wintun: destroy devinfolist after usage --- tun/wintun/wintun_windows.go | 1 + 1 file changed, 1 insertion(+) (limited to 'tun') 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) -- cgit v1.2.3