mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
res_pjsip.c: Add missing off nominal cleanup in ast_sip_push_task_synchronous().
* Made memset the std struct in ast_sip_push_task_synchronous() because if DEBUG_THREADS is enabled then uninitialized lock tracking data is used. ........ Merged revisions 423894 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 423895 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2786,18 +2786,22 @@ int ast_sip_push_task_synchronous(struct ast_taskprocessor *serializer, int (*si
|
||||
return sip_task(task_data);
|
||||
}
|
||||
|
||||
memset(&std, 0, sizeof(std));
|
||||
ast_mutex_init(&std.lock);
|
||||
ast_cond_init(&std.cond, NULL);
|
||||
std.fail = std.complete = 0;
|
||||
std.task = sip_task;
|
||||
std.task_data = task_data;
|
||||
|
||||
if (serializer) {
|
||||
if (ast_taskprocessor_push(serializer, sync_task, &std)) {
|
||||
ast_mutex_destroy(&std.lock);
|
||||
ast_cond_destroy(&std.cond);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
if (ast_threadpool_push(sip_threadpool, sync_task, &std)) {
|
||||
ast_mutex_destroy(&std.lock);
|
||||
ast_cond_destroy(&std.cond);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user