mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/cli: fix memory leaked when querying wmi instance
By ensuring the instance is closed when query finished.
This commit is contained in:
committed by
Cuong Manh Le
parent
087c1975e5
commit
6fd3d1788a
@@ -44,6 +44,7 @@ func validInterfaces() []string {
|
||||
mainLog.Load().Err(err).Msg("failed to get wmi network adapter")
|
||||
return nil
|
||||
}
|
||||
defer instances.Close()
|
||||
var adapters []string
|
||||
for _, i := range instances {
|
||||
adapter, err := netadapter.NewNetworkAdapter(i)
|
||||
|
||||
Reference in New Issue
Block a user