Skip to content

Commit 6b51d02

Browse files
authored
Merge pull request #2585 from scottp-dpaw/lbendpoint_fix
service_linux: Fix null dereference in findLBEndpointSandbox
2 parents d511c60 + 2fe6352 commit 6b51d02

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

service_linux.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ func (n *network) findLBEndpointSandbox() (*endpoint, *sandbox, error) {
6767
if !ok {
6868
return nil, nil, fmt.Errorf("Unable to get sandbox for %s(%s) in for %s", ep.Name(), ep.ID(), n.ID())
6969
}
70-
ep = sb.getEndpoint(ep.ID())
71-
if ep == nil {
70+
var sep *endpoint
71+
sep = sb.getEndpoint(ep.ID())
72+
if sep == nil {
7273
return nil, nil, fmt.Errorf("Load balancing endpoint %s(%s) removed from %s", ep.Name(), ep.ID(), n.ID())
7374
}
74-
return ep, sb, nil
75+
return sep, sb, nil
7576
}
7677

7778
// Searches the OS sandbox for the name of the endpoint interface

0 commit comments

Comments
 (0)