Module: kamailio
Branch: master
Commit: ffc485212457499fdfa7c9ebb8dc1b04a4058bfb
URL:
https://github.com/kamailio/kamailio/commit/ffc485212457499fdfa7c9ebb8dc1b0…
Author: jaybeepee <jason.penton(a)gmail.com>
Committer: jaybeepee <jason.penton(a)gmail.com>
Date: 2015-09-17T11:28:09+02:00
modules/ims_usrloc_pcscf: fixed free of service_routes from pcontact in P-CSCF
---
Modified: modules/ims_usrloc_pcscf/pcontact.c
Modified: modules/ims_usrloc_pcscf/udomain.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ffc485212457499fdfa7c9ebb8dc1b0…
Patch:
https://github.com/kamailio/kamailio/commit/ffc485212457499fdfa7c9ebb8dc1b0…
---
diff --git a/modules/ims_usrloc_pcscf/pcontact.c b/modules/ims_usrloc_pcscf/pcontact.c
index 1bb0af2..33e4a8a 100644
--- a/modules/ims_usrloc_pcscf/pcontact.c
+++ b/modules/ims_usrloc_pcscf/pcontact.c
@@ -270,10 +270,10 @@ void free_pcontact(pcontact_t* _c) {
for (i = 0; i < _c->num_service_routes; i++) {
if (_c->service_routes[i].s)
shm_free(_c->service_routes[i].s);
- shm_free(_c->service_routes);
- _c->service_routes = 0;
- _c->num_service_routes = 0;
}
+ shm_free(_c->service_routes);
+ _c->service_routes = 0;
+ _c->num_service_routes = 0;
}
if (_c->rx_session_id.len > 0 && _c->rx_session_id.s)
diff --git a/modules/ims_usrloc_pcscf/udomain.c b/modules/ims_usrloc_pcscf/udomain.c
index e1f2ef5..421cf52 100644
--- a/modules/ims_usrloc_pcscf/udomain.c
+++ b/modules/ims_usrloc_pcscf/udomain.c
@@ -354,10 +354,10 @@ int update_pcontact(struct udomain* _d, struct pcontact_info* _ci,
struct pconta
for (i=0; i<_c->num_service_routes; i++) {
if (_c->service_routes[i].s)
shm_free(_c->service_routes[i].s);
- shm_free(_c->service_routes);
- _c->service_routes=0;
- _c->num_service_routes=0;
}
+ shm_free(_c->service_routes);
+ _c->service_routes=0;
+ _c->num_service_routes=0;
}
//now add the new service routes
if (_ci->num_service_routes > 0) {