Fix missing GetObjectNInfo Closure (#11243)

Review for missing Close of returned value from `GetObjectNInfo`.

This was often obscured by the stuff that auto-unlocks when reaching EOF.
This commit is contained in:
Klaus Post
2021-01-08 10:12:26 -08:00
committed by GitHub
parent 4593b146be
commit 51dad1d130
4 changed files with 13 additions and 10 deletions
+2 -2
View File
@@ -341,13 +341,13 @@ func transitionObject(ctx context.Context, objectAPI ObjectLayer, objInfo Object
}
oi := gr.ObjInfo
if oi.TransitionStatus == lifecycle.TransitionComplete {
gr.Close() // make sure to avoid leaks.
gr.Close()
return nil
}
putOpts := putTransitionOpts(oi)
if _, err = tgt.PutObject(ctx, arn.Bucket, oi.Name, gr, oi.Size, "", "", putOpts); err != nil {
gr.Close() // make sure to avoid leaks.
gr.Close()
return err
}
gr.Close()