Module: kamailio
Branch: master
Commit: 4d128677eeaed3ec3a4dfea88ee16767bf2552a7
URL:
https://github.com/kamailio/kamailio/commit/4d128677eeaed3ec3a4dfea88ee1676…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-01-30T13:21:53+01:00
corex: close fd if ftell() fails inside file_read()
---
Modified: src/modules/corex/corex_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4d128677eeaed3ec3a4dfea88ee1676…
Patch:
https://github.com/kamailio/kamailio/commit/4d128677eeaed3ec3a4dfea88ee1676…
---
diff --git a/src/modules/corex/corex_mod.c b/src/modules/corex/corex_mod.c
index a489731..5f3c110 100644
--- a/src/modules/corex/corex_mod.c
+++ b/src/modules/corex/corex_mod.c
@@ -343,6 +343,7 @@ static int w_file_read(sip_msg_t *msg, char *fn, char *vn)
fsize = ftell(f);
if(fsize<0) {
LM_ERR("ftell failed on file: %.*s\n", fname.len, fname.s);
+ fclose(f);
return -1;
}
fseek(f, 0, SEEK_SET);