Module: kamailio
Branch: master
Commit: e7d684ad22d17f3aca58dd66c555e43877d9320a
URL:
https://github.com/kamailio/kamailio/commit/e7d684ad22d17f3aca58dd66c555e43…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-12-30T17:44:14+01:00
ims_isc: free variable in case of errors
---
Modified: src/modules/ims_isc/checker.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e7d684ad22d17f3aca58dd66c555e43…
Patch:
https://github.com/kamailio/kamailio/commit/e7d684ad22d17f3aca58dd66c555e43…
---
diff --git a/src/modules/ims_isc/checker.c b/src/modules/ims_isc/checker.c
index 44611822ad..f02cf98bab 100644
--- a/src/modules/ims_isc/checker.c
+++ b/src/modules/ims_isc/checker.c
@@ -369,6 +369,7 @@ static inline isc_match* isc_new_match(ims_filter_criteria *fc, int
index) {
if (!r->server_name.s) {
LM_ERR("isc_new_match(): error allocating %d bytes\n",
fc->application_server.server_name.len);
+ pkg_free(r);
return 0;
}
r->server_name.len = fc->application_server.server_name.len;
@@ -381,6 +382,10 @@ static inline isc_match* isc_new_match(ims_filter_criteria *fc, int
index) {
if (!r->service_info.s) {
LM_ERR("isc_new_match(): error allocating %d bytes\n",
fc->application_server.service_info.len);
+ if (r->server_name.s) {
+ pkg_free(r->server_name.s);
+ }
+ pkg_free(r);
return 0;
}
r->service_info.len = fc->application_server.service_info.len;