Merge pull request #7370 from wzshiming/fix/missing-close

This commit is contained in:
Derek McGowan 2022-09-07 08:19:41 -07:00 committed by GitHub
commit dbd3c8c5b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -410,6 +410,7 @@ func writeJSON(ctx context.Context, cs content.Store, x interface{}, oldDesc oci
return nil, err
}
if err := content.Copy(ctx, w, bytes.NewReader(b), int64(len(b)), dgst, content.WithLabels(labels)); err != nil {
w.Close()
return nil, err
}
if err := w.Close(); err != nil {