From 36ef521c0e08e4920b29a3f72e337f21a9b5b807 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Sat, 26 Apr 2014 17:36:20 +0200 Subject: [PATCH] Fix filehandle leak in proc_get_jiffies --- proc.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/proc.cpp b/proc.cpp index 2ea0d1bd4..66a258270 100644 --- a/proc.cpp +++ b/proc.cpp @@ -845,15 +845,16 @@ unsigned long proc_get_jiffies(process_t *p) &cnswap, &exit_signal, &processor ); + /* + Don't need to check exit status of fclose on read-only streams + */ + fclose(f); + if (count < 17) { return 0; } - /* - Don't need to check exit status of fclose on read-only streams - */ - fclose(f); return utime+stime+cutime+cstime; }