Parcourir la source

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

Carsten Bock il y a 10 ans
Parent
commit
a4e9f2234f
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      modules/registrar/regpv.c

+ 1 - 1
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;
 			c0->instance.len = ptr->instance.len;
 			p += c0->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;
 			c0->tcpconn_id = ptr->tcpconn_id;
 		}
 		}