diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-08 14:34:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-08 14:34:47 +0200 |
commit | d117d086b7d714ababc3dc14e1f80064dc9e9e57 (patch) | |
tree | 823256ce70e09fd5372747673347165171085aee | |
parent | 051f8b0a62784ea625e7690bdd63c754226416b9 (diff) | |
parent | db33f06a9510d13a8fe24ca4a641b8f3abeb3b04 (diff) | |
download | podman-d117d086b7d714ababc3dc14e1f80064dc9e9e57.tar.gz podman-d117d086b7d714ababc3dc14e1f80064dc9e9e57.tar.bz2 podman-d117d086b7d714ababc3dc14e1f80064dc9e9e57.zip |
Merge pull request #15665 from thediveo/data-race
fixes data race in system.Events and nil error logging
-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) + } }() } |