diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-08-25 14:42:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-25 14:42:12 -0400 |
commit | 49cfed756f5dfb6d9267eb29d31f651578c9037c (patch) | |
tree | 677b6acfee4b6fddc1b08d8181ce3552a5ccab68 /pkg/bindings/secrets | |
parent | fefa0b32c74fc5d394a0e2bd5b4564bedb3ed15d (diff) | |
parent | 1dc6d14735eef1e51368103aefba3d7c704dcfe3 (diff) | |
download | podman-49cfed756f5dfb6d9267eb29d31f651578c9037c.tar.gz podman-49cfed756f5dfb6d9267eb29d31f651578c9037c.tar.bz2 podman-49cfed756f5dfb6d9267eb29d31f651578c9037c.zip |
Merge pull request #11103 from jwhonce/wip/bindings
Fix file descriptor leaks in bindings and add test
Diffstat (limited to 'pkg/bindings/secrets')
-rw-r--r-- | pkg/bindings/secrets/secrets.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/bindings/secrets/secrets.go b/pkg/bindings/secrets/secrets.go index 091d38e56..b741d3e5c 100644 --- a/pkg/bindings/secrets/secrets.go +++ b/pkg/bindings/secrets/secrets.go @@ -22,6 +22,8 @@ func List(ctx context.Context, options *ListOptions) ([]*entities.SecretInfoRepo if err != nil { return secrs, err } + defer response.Body.Close() + return secrs, response.Process(&secrs) } @@ -38,6 +40,8 @@ func Inspect(ctx context.Context, nameOrID string, options *InspectOptions) (*en if err != nil { return inspect, err } + defer response.Body.Close() + return inspect, response.Process(&inspect) } @@ -52,6 +56,8 @@ func Remove(ctx context.Context, nameOrID string) error { if err != nil { return err } + defer response.Body.Close() + return response.Process(nil) } @@ -74,5 +80,7 @@ func Create(ctx context.Context, reader io.Reader, options *CreateOptions) (*ent if err != nil { return nil, err } + defer response.Body.Close() + return create, response.Process(&create) } |