Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Fix possible segfault, when getting stat for non-existent Postgres co…
Browse files Browse the repository at this point in the history
…nfig file.
  • Loading branch information
lesovsky committed Aug 25, 2021
1 parent 8e7097f commit acdb3dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/collector/postgres_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ func parsePostgresFiles(r *model.PGResult) []postgresFile {
fi, err := os.Stat(path)
if err != nil {
log.Warnf("stat %s failed: %s; skip", path, err)
continue
}

mode := fmt.Sprintf("%04o", fi.Mode().Perm())
Expand Down

0 comments on commit acdb3dc

Please sign in to comment.