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 Jan 13, 2021
1 parent 6bcef8a commit 75a41e0
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 75a41e0

Please sign in to comment.