]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
dont leak this in other cases.
authorBrian West <brian@freeswitch.org>
Thu, 4 Jun 2009 14:10:31 +0000 (14:10 +0000)
committerBrian West <brian@freeswitch.org>
Thu, 4 Jun 2009 14:10:31 +0000 (14:10 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13612 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_reg.c

index f01aaf29145c4de8ca739203c63fa61bf290aa24..a3dd31b5e7b7c5dd598b943735bdf37e05ef243d 100644 (file)
@@ -342,10 +342,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
                                                           NUTAG_OUTBOUND("no-options-keepalive"), NUTAG_OUTBOUND("no-validate"), NUTAG_KEEPALIVE(0), TAG_NULL());
                        }
                        gateway_ptr->retry = now + gateway_ptr->retry_seconds;
-                       gateway_ptr->state = REG_STATE_TRYING;
-                       
-                       switch_safe_free(user_via);
-                       
+                       gateway_ptr->state = REG_STATE_TRYING;                  
                        break;
 
                case REG_STATE_FAILED:
@@ -374,6 +371,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
                if (ostate != gateway_ptr->state) {
                        sofia_reg_fire_custom_gateway_state_event(gateway_ptr);
                }
+               switch_safe_free(user_via);
        }
 }