mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
XL: Close the reader properly.
This commit is contained in:
parent
7d6ed50fc2
commit
62b4fd6964
@ -70,8 +70,7 @@ func (m MultipartObjectInfo) GetPartNumberOffset(offset int64) (partIndex int, p
|
||||
return
|
||||
}
|
||||
|
||||
// getMultipartObjectMeta - incomplete meta file and extract meta
|
||||
// information if any.
|
||||
// getMultipartObjectMeta - incomplete meta file and extract meta information if any.
|
||||
func getMultipartObjectMeta(storage StorageAPI, metaFile string) (meta map[string]string, err error) {
|
||||
meta = make(map[string]string)
|
||||
offset := int64(0)
|
||||
@ -79,13 +78,14 @@ func getMultipartObjectMeta(storage StorageAPI, metaFile string) (meta map[strin
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Close the metadata reader.
|
||||
defer objMetaReader.Close()
|
||||
|
||||
decoder := json.NewDecoder(objMetaReader)
|
||||
err = decoder.Decode(&meta)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Close the metadata reader.
|
||||
objMetaReader.Close()
|
||||
return meta, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user