Module: kamailio
Branch: master
Commit: 90284a0f43a6782d0241e1e48c0dcfc3b084ddeb
URL:
https://github.com/kamailio/kamailio/commit/90284a0f43a6782d0241e1e48c0dcfc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-11-02T15:42:55+01:00
ratelimit: close file pointer in case of scan error
---
Modified: modules/ratelimit/ratelimit.c
---
Diff:
https://github.com/kamailio/kamailio/commit/90284a0f43a6782d0241e1e48c0dcfc…
Patch:
https://github.com/kamailio/kamailio/commit/90284a0f43a6782d0241e1e48c0dcfc…
---
diff --git a/modules/ratelimit/ratelimit.c b/modules/ratelimit/ratelimit.c
index dc5748f..69fcd74 100644
--- a/modules/ratelimit/ratelimit.c
+++ b/modules/ratelimit/ratelimit.c
@@ -338,6 +338,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);