Merge pull request #2312 from tedyu/cgrp-path-rollback

Properly remove intermediate directory
This commit is contained in:
Michael Crosby 2020-04-13 12:28:32 -04:00 committed by GitHub
commit 13431e0ece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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)