瀏覽代碼

modules/ims_registrar_pcscf: remove erroneous return

jaybeepee 10 年之前
父節點
當前提交
b71143a6b1
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      modules/ims_registrar_pcscf/service_routes.c

+ 5 - 2
modules/ims_registrar_pcscf/service_routes.c

@@ -308,7 +308,11 @@ int check_service_routes(struct sip_msg* _m, udomain_t* _d) {
 	/* Lock this record while working with the data: */
 	/* Lock this record while working with the data: */
 	ul.lock_udomain(_d, &vb->host, port, proto);
 	ul.lock_udomain(_d, &vb->host, port, proto);
         
         
-        pcontact_t * c = getContactP(_m, _d);
+	pcontact_t * c = getContactP(_m, _d);
+	if (!c) {
+		LM_DBG("no contact found in usrloc when checking for service route\n");
+		goto error;
+	}
 
 
 	/* Check the route-set: */
 	/* Check the route-set: */
 	if (_m->route) {
 	if (_m->route) {
@@ -386,7 +390,6 @@ error:
 	/* Unlock domain */
 	/* Unlock domain */
 	ul.unlock_udomain(_d, &vb->host, port, proto);
 	ul.unlock_udomain(_d, &vb->host, port, proto);
 	return -1;
 	return -1;
-    return 1;
 }
 }
 
 
 static str route_start={"Route: <",8};
 static str route_start={"Route: <",8};