diff --git a/internal/server/rpc.go b/internal/server/rpc.go index 78ae4664b7..748d13bbca 100644 --- a/internal/server/rpc.go +++ b/internal/server/rpc.go @@ -297,6 +297,7 @@ func (t *Server) Export(file string, reply *string) error { if err != nil { return err } + defer f.Close() exported, counts, err := rulesetProcessor.Export() if err != nil { return err