Skip to content

Commit

Permalink
fix: close calls on FindServers* should be deferred
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Aug 22, 2023
1 parent 13215ee commit 15299f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func FindServers(ctx context.Context, endpoint string, opts ...Option) ([]*ua.Ap
if err := c.Dial(ctx); err != nil {
return nil, err
}
c.Close(ctx)
defer c.Close(ctx)
res, err := c.FindServers(ctx)
if err != nil {
return nil, err
Expand All @@ -55,7 +55,7 @@ func FindServersOnNetwork(ctx context.Context, endpoint string, opts ...Option)
if err := c.Dial(ctx); err != nil {
return nil, err
}
c.Close(ctx)
defer c.Close(ctx)
res, err := c.FindServersOnNetwork(ctx)
if err != nil {
return nil, err
Expand Down

0 comments on commit 15299f4

Please sign in to comment.