From: George Joseph Date: Thu, 8 Jan 2015 21:38:26 +0000 (+0000) Subject: res_pjsip_outbound_registration: Fix reference leak. X-Git-Tag: 14.0.0-beta1~1340 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c55f86c69d5e99492fb95b6a375085ce33f23ae0;p=thirdparty%2Fasterisk.git res_pjsip_outbound_registration: Fix reference leak. Every time a registration started, sip_outbound_registration_response_cb bumps the ref count on client_state then pushes a handle_registration_response task. handle_registration_response never unreffed it though. So every time a registration goes out, the ref count goes up by one. This patch adds the unreffs to handle_registration_response. Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4303/ ........ Merged revisions 430395 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430396 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c index 6ccb7fcf23..b2e9bb0457 100644 --- a/res/res_pjsip_outbound_registration.c +++ b/res/res_pjsip_outbound_registration.c @@ -462,7 +462,7 @@ static int handle_client_registration(void *data) pjsip_regc_info info; char server_uri[PJSIP_MAX_URL_SIZE], client_uri[PJSIP_MAX_URL_SIZE]; - cancel_registration(client_state); + ao2_ref(client_state, -1); if ((client_state->status == SIP_REGISTRATION_STOPPED) || (pjsip_regc_register(client_state->client, PJ_FALSE, &tdata) != PJ_SUCCESS)) {