Skip to content

Commit

Permalink
🐛 internal: fix a possible temporary directory leak
Browse files Browse the repository at this point in the history
a temporary directory leak was found when running the tests

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
  • Loading branch information
zhijianli88 committed Feb 18, 2021
1 parent 3c5b358 commit 1614901
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/internal/testing/integration/internal/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ func DoDefaulting(

if path == "" {
if name == "" {
if defaults.DirNeedsCleaning {
os.RemoveAll(defaults.Dir)
}
return DefaultedProcessInput{}, fmt.Errorf("must have at least one of name or path")
}
defaults.Path = BinPathFinder(name)
Expand Down

0 comments on commit 1614901

Please sign in to comment.