From: Corey Farrell Date: Mon, 14 Apr 2014 15:50:30 +0000 (+0000) Subject: autoservice: fix reference leak of logger callid. X-Git-Tag: 11.10.0-rc1~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bf7f01aeea7a04202f017096ce8f105644940a2;p=thirdparty%2Fasterisk.git autoservice: fix reference leak of logger callid. autoservice acquires a local reference to the logger callid of each channel in a loop. This local reference was not released, causing the callid of every channel in autoservice to leak. This change moves the callid unref inside the loop. ASTERISK-23616 #close Reported by: ibercom git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@412305 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/autoservice.c b/main/autoservice.c index 5b0c722efd..1590c8537a 100644 --- a/main/autoservice.c +++ b/main/autoservice.c @@ -131,6 +131,9 @@ static void *autoservice_run(void *ign) callid = ast_channel_callid(chan); ast_callid_threadassoc_change(callid); + if (callid) { + callid = ast_callid_unref(callid); + } f = ast_read(chan); @@ -174,11 +177,6 @@ static void *autoservice_run(void *ign) } } - if (callid) { - ast_callid_threadassoc_remove(); - callid = ast_callid_unref(callid); - } - asthread = AST_PTHREADT_NULL; return NULL;