[asterisk-commits] rmudgett: trunk r430903 - in /trunk: ./ res/res_pjsip_outbound_registration.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 21 15:57:47 CST 2015


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;
 }




More information about the asterisk-commits mailing list