1
0
mirror of https://github.com/minio/minio synced 2024-07-08 19:56:05 +00:00

XL: Close the reader properly.

This commit is contained in:
Harshavardhana 2016-05-18 20:16:19 -07:00
parent 7d6ed50fc2
commit 62b4fd6964

View File

@ -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
}