[asterisk-commits] rmudgett: branch 13 r430902 - /branches/13/res/res_pjsip_outbound_registration.c

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


Author: rmudgett
Date: Wed Jan 21 15:53:51 2015
New Revision: 430902

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=430902
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.

Modified:
    branches/13/res/res_pjsip_outbound_registration.c

Modified: branches/13/res/res_pjsip_outbound_registration.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip_outbound_registration.c?view=diff&rev=430902&r1=430901&r2=430902
==============================================================================
--- branches/13/res/res_pjsip_outbound_registration.c (original)
+++ branches/13/res/res_pjsip_outbound_registration.c Wed Jan 21 15:53:51 2015
@@ -398,8 +398,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;
@@ -448,6 +446,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