[sr-dev] git:master:ffc48521: modules/ims_usrloc_pcscf: fixed free of service_routes from pcontact in P-CSCF

jaybeepee jason.penton at gmail.com
Thu Sep 17 11:28:25 CEST 2015


Module: kamailio
Branch: master
Commit: ffc485212457499fdfa7c9ebb8dc1b04a4058bfb
URL: https://github.com/kamailio/kamailio/commit/ffc485212457499fdfa7c9ebb8dc1b04a4058bfb

Author: jaybeepee <jason.penton at gmail.com>
Committer: jaybeepee <jason.penton at 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/ffc485212457499fdfa7c9ebb8dc1b04a4058bfb.diff
Patch: https://github.com/kamailio/kamailio/commit/ffc485212457499fdfa7c9ebb8dc1b04a4058bfb.patch

---

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) {




More information about the sr-dev mailing list