mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
pw: Fix a resource leak.
Reported by: Coverity MFC after: 1 week Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc.
This commit is contained in:
parent
45bfd3158c
commit
7a82cf511d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=365045
|
@ -57,6 +57,10 @@ rm_r(int rootfd, const char *path, uid_t uid)
|
|||
}
|
||||
|
||||
d = fdopendir(dirfd);
|
||||
if (d == NULL) {
|
||||
(void)close(dirfd);
|
||||
return;
|
||||
}
|
||||
while ((e = readdir(d)) != NULL) {
|
||||
if (strcmp(e->d_name, ".") == 0 || strcmp(e->d_name, "..") == 0)
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue