DIR is not closed if chdir errors occur. Signed-off-by: Vitaly Chikunov <vt@xxxxxxxxxxxx> --- src/evmctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/evmctl.c b/src/evmctl.c index 53711f4..b65139b 100644 --- a/src/evmctl.c +++ b/src/evmctl.c @@ -1344,6 +1344,7 @@ static int find(const char *path, int dts, find_cb_t func) if (fchdir(dirfd(dir))) { log_err("Failed to chdir %s\n", path); + closedir(dir); return -1; } @@ -1359,6 +1360,7 @@ static int find(const char *path, int dts, find_cb_t func) if (chdir("..")) { log_err("Failed to chdir: %s\n", path); + closedir(dir); return -1; } -- 2.11.0