X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.c;h=e7ff0f8840fdbe5d85c82e0c55d0367a4833c2b7;hb=836cf0905c4a8fe3358d6b0e005192d5ee51d3e2;hp=dbdb69270de7a7db7163397ff5df9a2e08f4ef17;hpb=da92ca5eb506d513033e0c7a85daf25a7e1c9d0e;p=elogind.git diff --git a/src/shared/util.c b/src/shared/util.c index dbdb69270..e7ff0f884 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -1440,7 +1440,7 @@ _pure_ static bool fd_in_set(int fd, const int fdset[], unsigned n_fdset) { } int close_all_fds(const int except[], unsigned n_except) { - DIR *d; + _cleanup_closedir_ DIR *d = NULL; struct dirent *de; int r = 0; @@ -1495,7 +1495,6 @@ int close_all_fds(const int except[], unsigned n_except) { } } - closedir(d); return r; }