diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2010-06-09 09:59:52 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-06-10 10:17:21 -0400 |
commit | 9a193114a64965459dd085d39e36144bcd5b3063 (patch) | |
tree | 3e8b1939a9ca5bb7f2d0cbdfa1b00e5fb0c69b36 /common/path_utils | |
parent | a05ee9b926d398318e36944813a313bdff5eb999 (diff) | |
download | sssd_unused-9a193114a64965459dd085d39e36144bcd5b3063.tar.gz sssd_unused-9a193114a64965459dd085d39e36144bcd5b3063.tar.xz sssd_unused-9a193114a64965459dd085d39e36144bcd5b3063.zip |
Don't leak directory access resources on errors in directory_list()
https://fedorahosted.org/sssd/ticket/514
Diffstat (limited to 'common/path_utils')
-rw-r--r-- | common/path_utils/path_utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/path_utils/path_utils.c b/common/path_utils/path_utils.c index 493e0a4d..97c845c7 100644 --- a/common/path_utils/path_utils.c +++ b/common/path_utils/path_utils.c @@ -538,6 +538,10 @@ int directory_list(const char *path, bool recursive, error = path_concat(entry_path, sizeof(entry_path), path, entry->d_name); if (error != SUCCESS) { + closedir(dir); + /* Don't bother checking the return here. + * The path_concat error is more important + */ return error; } @@ -551,6 +555,10 @@ int directory_list(const char *path, bool recursive, error = directory_list(entry_path, recursive, callback, user_data); if (error != SUCCESS) { + closedir(dir); + /* Don't bother checking the return here. + * The directory_list error is more important + */ return error; } } |