From: Richard Mudgett Date: Thu, 25 Sep 2014 21:00:08 +0000 (+0000) Subject: res_pjsip.c: Add missing off nominal cleanup in ast_sip_push_task_synchronous(). X-Git-Tag: 12.7.0-rc1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=244319643ec7e3456e48d40046303f46dc4feb5a;p=thirdparty%2Fasterisk.git 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@423894 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip.c b/res/res_pjsip.c index cb84f90765..9afd26fada 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -2241,18 +2241,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; } }