From: Aleksinski, MichalX Date: Fri, 26 Oct 2018 01:02:09 +0000 (+0100) Subject: intel_rdt: close file descriptor on error X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e0d53a085d1e2675ba24645aad4a50ef8c771c16;p=collectd.git intel_rdt: close file descriptor on error Change-Id: I161c8df1e6a4c4c4e0dd4e20601323ef7a1c18f5 --- 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;