Merge pull request #2312 from tedyu/cgrp-path-rollback
Properly remove intermediate directory
This commit is contained in:
commit
13431e0ece
|
@ -241,6 +241,7 @@ func createCgroupsv2Path(path string) (Err error) {
|
|||
}
|
||||
} else {
|
||||
// If the directory was created, be sure it is not left around on errors.
|
||||
current := current
|
||||
defer func() {
|
||||
if Err != nil {
|
||||
os.Remove(current)
|
||||
|
|
Loading…
Reference in New Issue