ima-evm-utils: Fix possible DIR leak in find
PATCH 1/1 ima-evm-utils: Fix possible DIR leak in find
DIR is not closed if chdir errors occur.
Signed-off-by Vitaly Chikunov <[email protected]>
--- src/evmctl.c | 2 ++ 1 file changed, 2 insertions(+)
src/evmctl.c +2 -0
@@ -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 ; }
Signature · 1 line
2.11.0