Author: rmudgett
Date: Wed Jan 21 15:57:45 2015
New Revision: 430903

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=430903
Log:
res_pjsip_outbound_registration.c: Move unref to a better place.

Move an unconditional unref of client_state so it doesn't look like it
could be used after the last ref has destroyed it.
........

Merged revisions 430902 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip_outbound_registration.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/res/res_pjsip_outbound_registration.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_outbound_registration.c?view=diff&rev=430903&r1=430902&r2=430903
==============================================================================
--- trunk/res/res_pjsip_outbound_registration.c (original)
+++ trunk/res/res_pjsip_outbound_registration.c Wed Jan 21 15:57:45 2015
@@ -462,8 +462,6 @@
        pjsip_regc_info info;
        char server_uri[PJSIP_MAX_URL_SIZE], client_uri[PJSIP_MAX_URL_SIZE];
 
-       ao2_ref(client_state, -1);
-
        if ((client_state->status == SIP_REGISTRATION_STOPPED) ||
                (pjsip_regc_register(client_state->client, PJ_FALSE, &tdata) != 
PJ_SUCCESS)) {
                return 0;
@@ -512,6 +510,7 @@
                ast_log(LOG_WARNING, "Failed to pass outbound registration to 
threadpool\n");
                ao2_ref(client_state, -1);
        }
+       ao2_ref(client_state, -1);
 
        entry->id = 0;
 }


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to