wintun: destroy devinfolist after usage

This commit is contained in:
Jason A. Donenfeld 2019-05-10 20:19:11 +02:00
parent 1c92b48415
commit a6045ac042

View file

@ -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)