Selaa lähdekoodia

modules/registrar: tidied up unregister() function

Peter Dunkley 12 vuotta sitten
vanhempi
commit
dd90d9685c
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 4 4
      modules/registrar/save.c

+ 4 - 4
modules/registrar/save.c

@@ -968,10 +968,6 @@ int unregister(struct sip_msg* _m, udomain_t* _d, str* _uri, str *_ruid)
 	urecord_t *r;
 	ucontact_t *c;
 
-	u = parse_to_uri(_m);
-	if(u==NULL)
-		return -2;
-
 	if (extract_aor(_uri, &aor, NULL) < 0) {
 		LM_ERR("failed to extract Address Of Record\n");
 		return -1;
@@ -980,6 +976,10 @@ int unregister(struct sip_msg* _m, udomain_t* _d, str* _uri, str *_ruid)
 	if (_ruid == NULL) {
 		/* No ruid provided - remove all contacts for aor */
 
+		u = parse_to_uri(_m);
+		if(u==NULL)
+			return -2;
+
 		if (star(_m, _d, &aor, &u->host) < 0)
 		{
 			LM_ERR("error unregistering user [%.*s]\n", aor.len, aor.s);