better cleanup

This commit is contained in:
wh1te909 2022-08-09 12:41:07 -07:00
parent 607a5283ac
commit 662c41794b
2 changed files with 2 additions and 0 deletions

View File

@ -444,6 +444,7 @@ func (a *Agent) RunPythonCode(code string, timeout int, args []string) (string,
a.Logger.Debugln(err) a.Logger.Debugln(err)
return "", err return "", err
} }
defer os.Remove(tmpfn.Name())
if err := tmpfn.Close(); err != nil { if err := tmpfn.Close(); err != nil {
a.Logger.Debugln(err) a.Logger.Debugln(err)
return "", err return "", err

View File

@ -577,6 +577,7 @@ func (a *Agent) UninstallCleanup() {
a.PatchMgmnt(false) a.PatchMgmnt(false)
a.CleanupAgentUpdates() a.CleanupAgentUpdates()
CleanupSchedTasks() CleanupSchedTasks()
os.RemoveAll(winTempDir)
} }
func (a *Agent) AgentUpdate(url, inno, version string) { func (a *Agent) AgentUpdate(url, inno, version string) {