[sr-dev] git:4.3:a4e9f223: registrar: ptr->sock may not be available, as we received the info on a different channel (e.g. reginfo) (bugfix)

Carsten Bock carsten at ng-voice.com
Tue Jun 2 20:22:57 CEST 2015


Module: kamailio
Branch: 4.3
Commit: a4e9f2234f29928520cca83843d5d6aa387518ad
URL: https://github.com/kamailio/kamailio/commit/a4e9f2234f29928520cca83843d5d6aa387518ad

Author: Carsten Bock <carsten at ng-voice.com>
Committer: Carsten Bock <carsten at ng-voice.com>
Date: 2015-06-02T20:22:46+02:00

registrar: ptr->sock may not be available, as we received the info on a different channel (e.g. reginfo) (bugfix)

---

Modified: modules/registrar/regpv.c

---

Diff:  https://github.com/kamailio/kamailio/commit/a4e9f2234f29928520cca83843d5d6aa387518ad.diff
Patch: https://github.com/kamailio/kamailio/commit/a4e9f2234f29928520cca83843d5d6aa387518ad.patch

---

diff --git a/modules/registrar/regpv.c b/modules/registrar/regpv.c
index 8574e92..daf304e 100644
--- a/modules/registrar/regpv.c
+++ b/modules/registrar/regpv.c
@@ -544,7 +544,7 @@ int pv_fetch_contacts(struct sip_msg* msg, char* table, char* uri,
 			c0->instance.len = ptr->instance.len;
 			p += c0->instance.len;
 		}
-		if (ptr->sock->proto == PROTO_TCP || ptr->sock->proto == PROTO_TLS || ptr->sock->proto == PROTO_WS || ptr->sock->proto == PROTO_WSS)
+		if ((ptr->sock) && (ptr->sock->proto == PROTO_TCP || ptr->sock->proto == PROTO_TLS || ptr->sock->proto == PROTO_WS || ptr->sock->proto == PROTO_WSS))
 		{
 			c0->tcpconn_id = ptr->tcpconn_id;
 		}




More information about the sr-dev mailing list