aboutsummaryrefslogtreecommitdiffhomepage
path: root/proc.cpp
diff options
context:
space:
mode:
authorGravatar Konrad Borowski <GlitchMr@users.noreply.github.com>2014-04-26 17:36:20 +0200
committerGravatar Konrad Borowski <GlitchMr@users.noreply.github.com>2014-04-26 17:36:20 +0200
commit36ef521c0e08e4920b29a3f72e337f21a9b5b807 (patch)
treea28492b00e435a846973941f1533bc811c6a1ecb /proc.cpp
parenta475dd15e65759f2d20822cd3b19b874575c7f5e (diff)
Fix filehandle leak in proc_get_jiffies
Diffstat (limited to 'proc.cpp')
-rw-r--r--proc.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/proc.cpp b/proc.cpp
index 2ea0d1bd..66a25827 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;
}