diff options
author | Richard Mudgett <rmudgett@digium.com> | 2015-01-21 21:53:51 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2015-01-21 21:53:51 +0000 |
commit | 5e10007dbde4dcad25776708000ddd027d678cf7 (patch) | |
tree | d400a2e04bedccf998371546e917dbf0f688e053 | |
parent | 74a13629e210e00e79b430184c4197856877afe0 (diff) |
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.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | res/res_pjsip_outbound_registration.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c index aac0eb1f9..a1a88b618 100644 --- a/res/res_pjsip_outbound_registration.c +++ b/res/res_pjsip_outbound_registration.c @@ -398,8 +398,6 @@ static int handle_client_registration(void *data) 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 @@ static void sip_outbound_registration_timer_cb(pj_timer_heap_t *timer_heap, stru 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; } |