Skip to content

Commit 2fe6352

Browse files
committed
service_linux: Fix null dereference in findLBEndpointSandbox
Signed-off-by: Scott Percival <scottp@lastyard.com>
1 parent d095108 commit 2fe6352

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)