diff options
author | Harald Albrecht <harald.albrecht@gmx.net> | 2022-09-07 20:55:21 +0200 |
---|---|---|
committer | Harald Albrecht <harald.albrecht@gmx.net> | 2022-09-07 20:57:18 +0200 |
commit | db33f06a9510d13a8fe24ca4a641b8f3abeb3b04 (patch) | |
tree | 99fb631f1c824ffb389122f75a81abcb67374bab /pkg/bindings | |
parent | 3d482a7ef2eb6e307992cd8bbea1153827d5e085 (diff) | |
download | podman-db33f06a9510d13a8fe24ca4a641b8f3abeb3b04.tar.gz podman-db33f06a9510d13a8fe24ca4a641b8f3abeb3b04.tar.bz2 podman-db33f06a9510d13a8fe24ca4a641b8f3abeb3b04.zip |
fixes data race in system.Events and nil error logging
Signed-off-by: Harald Albrecht <harald.albrecht@gmx.net>
Diffstat (limited to 'pkg/bindings')
-rw-r--r-- | pkg/bindings/system/system.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/bindings/system/system.go b/pkg/bindings/system/system.go index dae80384b..733b2cb5c 100644 --- a/pkg/bindings/system/system.go +++ b/pkg/bindings/system/system.go @@ -36,8 +36,9 @@ func Events(ctx context.Context, eventChan chan entities.Event, cancelChan chan if cancelChan != nil { go func() { <-cancelChan - err = response.Body.Close() - logrus.Errorf("Unable to close event response body: %v", err) + if err := response.Body.Close(); err != nil { + logrus.Errorf("Unable to close event response body: %v", err) + } }() } |