Skip to content

Commit

Permalink
Fix memory leak for timers (#138)
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
  • Loading branch information
ondrej-fabry authored Jun 23, 2023
1 parent e330ce1 commit 14d176d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions adapter/socketclient/socketclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ func (c *Client) WaitReady() error {
}

timeout := time.NewTimer(MaxWaitReady)
defer timeout.Stop()
for {
select {
case <-timeout.C:
Expand Down Expand Up @@ -234,6 +235,7 @@ func waitForDir(dir string) error {
}

timeout := time.NewTimer(MaxWaitReady)
defer timeout.Stop()
for {
select {
case <-timeout.C:
Expand Down

0 comments on commit 14d176d

Please sign in to comment.