Skip to content

Commit

Permalink
osrelease: don't unconditionally defer
Browse files Browse the repository at this point in the history
  • Loading branch information
hdonnay committed Dec 10, 2019
1 parent 38bfe2d commit bb74bc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion osrelease/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ func (s *Scanner) Scan(ctx context.Context, l *claircore.Layer) ([]*claircore.Di
defer log.Debug().Msg("done")

r, err := l.Reader()
defer r.Close()
if err != nil {
return nil, fmt.Errorf("osrelease: unable to open layer: %w", err)
}
defer r.Close()

// iterate through the tar and attempt to parse each os-release file encountered.
// on a successful parse return the distribution.
Expand Down

0 comments on commit bb74bc1

Please sign in to comment.