From b3b0fa7ce9bcdc6c5f25ef9ed47dab23ac4c8d01 Mon Sep 17 00:00:00 2001 From: Gene Cumm Date: Sat, 2 Oct 2010 00:18:27 -0400 Subject: [PATCH] rosh: closedir() only if actually opened --- com32/rosh/rosh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com32/rosh/rosh.c b/com32/rosh/rosh.c index f5ed6cd..8d063e6 100644 --- a/com32/rosh/rosh.c +++ b/com32/rosh/rosh.c @@ -780,11 +780,11 @@ void rosh_ls_arg(const char *filestr, const int *optarr) ROSH_DEBUG("PATH '%s' is a directory\n", filestr); if (d = opendir(filestr)) { rosh_ls_arg_dir(filestr, d, optarr); + closedir(d); } else { rosh_error(errno, "ls", filestr); errno = 0; } - closedir(d); } else { de.d_ino = rosh_ls_d_ino(&fdstat); de.d_type = (IFTODT(fdstat.st_mode)); -- 2.7.4