mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-25 18:12:57 +01: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 New Issue
Block a user