1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

service_linux: Fix null dereference in findLBEndpointSandbox

Signed-off-by: Scott Percival <scottp@lastyard.com>
This commit is contained in:
Scott Percival 2020-09-22 14:56:03 +08:00
parent 20c88eb92f
commit 959dfca7e6

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