mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-28 15:11:12 +00:00
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 ........ Merged revisions 412305 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 412306 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -131,6 +131,9 @@ static void *autoservice_run(void *ign)
|
|||||||
|
|
||||||
callid = ast_channel_callid(chan);
|
callid = ast_channel_callid(chan);
|
||||||
ast_callid_threadassoc_change(callid);
|
ast_callid_threadassoc_change(callid);
|
||||||
|
if (callid) {
|
||||||
|
callid = ast_callid_unref(callid);
|
||||||
|
}
|
||||||
|
|
||||||
f = ast_read(chan);
|
f = ast_read(chan);
|
||||||
|
|
||||||
@@ -180,11 +183,6 @@ static void *autoservice_run(void *ign)
|
|||||||
* If we did, we'd need to ast_frfree(f) if (f). */
|
* If we did, we'd need to ast_frfree(f) if (f). */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (callid) {
|
|
||||||
ast_callid_threadassoc_remove();
|
|
||||||
callid = ast_callid_unref(callid);
|
|
||||||
}
|
|
||||||
|
|
||||||
asthread = AST_PTHREADT_NULL;
|
asthread = AST_PTHREADT_NULL;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user