Module: kamailio
Branch: master
Commit: 5591d9c908d3f55898d4cc810663654f1f289806
URL:
https://github.com/kamailio/kamailio/commit/5591d9c908d3f55898d4cc810663654…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-01-30T18:18:39+01:00
pipelimit: close file stream in case of error in get cpu
---
Modified: src/modules/pipelimit/pipelimit.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5591d9c908d3f55898d4cc810663654…
Patch:
https://github.com/kamailio/kamailio/commit/5591d9c908d3f55898d4cc810663654…
---
diff --git a/src/modules/pipelimit/pipelimit.c b/src/modules/pipelimit/pipelimit.c
index 5045055..32dec4a 100644
--- a/src/modules/pipelimit/pipelimit.c
+++ b/src/modules/pipelimit/pipelimit.c
@@ -222,6 +222,7 @@ static int get_cpuload(double * load)
if (fscanf(f, "cpu %lld%lld%lld%lld%lld%lld%lld%lld",
&n_user, &n_nice, &n_sys, &n_idle, &n_iow, &n_irq,
&n_sirq, &n_stl) < 0) {
LM_ERR("could not parse load information\n");
+ fclose(f);
return -1;
}
fclose(f);