Skip to content

Commit

Permalink
Merge pull request #18 from qustavo/fix_leaks
Browse files Browse the repository at this point in the history
fix leaks
  • Loading branch information
kevinmcconnell authored Sep 23, 2024
2 parents 556aa40 + 1a660f7 commit 726d173
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/server/health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (hc *HealthCheck) check() {
hc.consumer.HealthCheckCompleted(false)
return
}
defer resp.Body.Close()

if resp.StatusCode < 200 || resp.StatusCode > 299 {
slog.Info("Healthcheck failed", "status", resp.StatusCode)
Expand Down
1 change: 1 addition & 0 deletions internal/server/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (r *Router) RestoreLastSavedState() error {
slog.Error("Failed to restore saved state", "path", r.statePath, "error", err)
return err
}
defer f.Close()

var services []*Service
err = json.NewDecoder(f).Decode(&services)
Expand Down

0 comments on commit 726d173

Please sign in to comment.