fix the nil pointer panic on closing a disabled network manager

Issue #2768
This commit is contained in:
Vincent Batts 2013-11-22 14:28:49 -05:00
parent 60cb5f1a34
commit ef14aaf627

View file

@ -661,6 +661,9 @@ func (manager *NetworkManager) Allocate() (*NetworkInterface, error) {
}
func (manager *NetworkManager) Close() error {
if manager.disabled {
return nil
}
err1 := manager.tcpPortAllocator.Close()
err2 := manager.udpPortAllocator.Close()
err3 := manager.ipAllocator.Close()