From: Corey Farrell Date: Thu, 5 Oct 2017 20:54:12 +0000 (-0400) Subject: res_pjsip: Fix leak of fake_auth references. X-Git-Tag: 13.18.0-rc1~24^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5110600f1e5c8ce20acf57568731d81d54a39f5f;p=thirdparty%2Fasterisk.git res_pjsip: Fix leak of fake_auth references. pjsip_distributor leaks references to fake_auth when the default realm has not changed. ASTERISK-27306 Change-Id: I3fcf103b3680ad2d1d4610dcd6738eeaebf4d202 --- diff --git a/res/res_pjsip/pjsip_distributor.c b/res/res_pjsip/pjsip_distributor.c index 3f245eea06..591d7fea76 100644 --- a/res/res_pjsip/pjsip_distributor.c +++ b/res/res_pjsip/pjsip_distributor.c @@ -1132,9 +1132,9 @@ static void global_loaded(const char *object_type) fake_auth = alloc_artificial_auth(default_realm); if (fake_auth) { ao2_global_obj_replace_unref(artificial_auth, fake_auth); - ao2_ref(fake_auth, -1); } } + ao2_cleanup(fake_auth); ast_sip_get_unidentified_request_thresholds(&unidentified_count, &unidentified_period, &unidentified_prune_interval);