Unverified Commit fda9bfb7 by Christian Brauner Committed by GitHub

Merge pull request #3887 from simondeziel/closedir

initutils: close dirfd in error path
parents 804f3e2a 9884f0a6
...@@ -458,8 +458,10 @@ restart: ...@@ -458,8 +458,10 @@ restart:
if (fd == STDERR_FILENO || fd == fddir) if (fd == STDERR_FILENO || fd == fddir)
break; break;
if (close(fd)) if (close(fd)) {
closedir(dir);
return -errno; return -errno;
}
closedir(dir); closedir(dir);
goto restart; goto restart;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment