mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
fix: getObject fd leaks in transition and replication code (#11237)
This commit is contained in:
@@ -340,13 +340,14 @@ func transitionObject(ctx context.Context, objectAPI ObjectLayer, objInfo Object
|
||||
return err
|
||||
}
|
||||
oi := gr.ObjInfo
|
||||
|
||||
if oi.TransitionStatus == lifecycle.TransitionComplete {
|
||||
gr.Close() // make sure to avoid leaks.
|
||||
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.
|
||||
return err
|
||||
}
|
||||
gr.Close()
|
||||
|
||||
Reference in New Issue
Block a user