]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Sun, 19 Nov 2006 19:51:40 +0000 (19:51 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sun, 19 Nov 2006 19:51:40 +0000 (19:51 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3414 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 379536febb43ac74bcf1d6990694d60ad9026a9e..0f749e381b8149c467c3a9399647a1664fa9516b 100644 (file)
@@ -4150,43 +4150,44 @@ static void sip_r_register(int status,
 
                if (!(scheme && realm)) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No scheme and realm!\n");
+                       return;
                }
        }
 
-       if (!(scheme && realm)) {
-               return;
-       }
-
-       duprealm = strdup(realm);
-       qrealm = duprealm;
-       
-       while(qrealm && *qrealm && *qrealm == '"') {
-               qrealm++;
-       }
-       if ((p = strchr(qrealm, '"'))) {
-               *p = '\0';
-       }
 
        if (sofia_private) {
                if (sofia_private->oreg) {
                        oreg = sofia_private->oreg;
                } else if (profile) {
                        outbound_reg_t *oregp;
-                       for (oregp = profile->registrations; oregp; oregp = oregp->next) {
-                               if (scheme && qrealm && !strcasecmp(oregp->register_scheme, scheme) && !strcasecmp(oregp->register_realm, qrealm)) {
-                                       oreg = oregp;
-                                       break;
+
+                       if ((duprealm = strdup(realm))) {
+                               qrealm = duprealm;
+       
+                               while(*qrealm && *qrealm == '"') {
+                                       qrealm++;
+                               }
+                               if ((p = strchr(qrealm, '"'))) {
+                                       *p = '\0';
                                }
-                       }
-                       if (!oreg) {
-                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Match for Scheme [%s] Realm [%s]\n", scheme, qrealm);
-                       }
 
+                               for (oregp = profile->registrations; oregp; oregp = oregp->next) {
+                                       if (scheme && qrealm && !strcasecmp(oregp->register_scheme, scheme) && !strcasecmp(oregp->register_realm, qrealm)) {
+                                               oreg = oregp;
+                                               break;
+                                       }
+                               }
+                               if (!oreg) {
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No Match for Scheme [%s] Realm [%s]\n", scheme, qrealm);
+                               }
+                               switch_safe_free(duprealm);
+                       } else {
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
+                               return;
+                       }
                }
        }
 
-       switch_safe_free(duprealm);
-
        if (!oreg) {
                return;
        }