Merge pull request #2585 from scottp-dpaw/lbendpoint_fix

service_linux: Fix null dereference in findLBEndpointSandbox
This commit is contained in:
Sebastiaan van Stijn 2020-10-31 18:31:17 +01:00 committed by GitHub
commit fb9ecec127

View file

@ -67,11 +67,12 @@ func (n *network) findLBEndpointSandbox() (*endpoint, *sandbox, error) {
if !ok {
return nil, nil, fmt.Errorf("Unable to get sandbox for %s(%s) in for %s", ep.Name(), ep.ID(), n.ID())
}
ep = sb.getEndpoint(ep.ID())
if ep == nil {
var sep *endpoint
sep = sb.getEndpoint(ep.ID())
if sep == nil {
return nil, nil, fmt.Errorf("Load balancing endpoint %s(%s) removed from %s", ep.Name(), ep.ID(), n.ID())
}
return ep, sb, nil
return sep, sb, nil
}
// Searches the OS sandbox for the name of the endpoint interface