From e0d53a085d1e2675ba24645aad4a50ef8c771c16 Mon Sep 17 00:00:00 2001 From: "Aleksinski, MichalX" Date: Fri, 26 Oct 2018 02:02:09 +0100 Subject: [PATCH] intel_rdt: close file descriptor on error Change-Id: I161c8df1e6a4c4c4e0dd4e20601323ef7a1c18f5 --- src/utils_proc_pids.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils_proc_pids.c b/src/utils_proc_pids.c index 9b07e420..1a05fe4b 100644 --- a/src/utils_proc_pids.c +++ b/src/utils_proc_pids.c @@ -191,8 +191,10 @@ int fetch_pids_for_procs(const char *procfs_path, int init_result = initialize_proc_pids( procs_names_array, procs_names_array_size, proc_pids_array); - if (0 != init_result) + if (0 != init_result) { + closedir(proc_dir); return -1; + } /* Go through procfs and find PIDS and their comms */ struct dirent *entry; -- 2.11.0