summaryrefslogtreecommitdiff
path: root/res/res_pjsip.c
diff options
context:
space:
mode:
authorScott Griepentrog <sgriepentrog@digium.com>2015-02-06 21:26:12 +0000
committerScott Griepentrog <sgriepentrog@digium.com>2015-02-06 21:26:12 +0000
commit323c0927ac63ce1c13133961bd46abbf6d265a18 (patch)
tree442ac91b9baf5220443a5be83a8001d33a49198d /res/res_pjsip.c
parent18c8c1bae39e4a236f4cc5b2cfc1d759af624593 (diff)
various: cleanup issues found during leak hunt
In this collection of small patches to prevent Valgrind errors are: fixes for reference leaks in config hooks, evaluating a parameter beyond bounds, and accessing a structure after a lock where it could have been already free'd. Review: https://reviewboard.asterisk.org/r/4407/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r--res/res_pjsip.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index fd470b719..4427c4ecf 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -2965,13 +2965,16 @@ struct sync_task_data {
static int sync_task(void *data)
{
struct sync_task_data *std = data;
+ int ret;
+
std->fail = std->task(std->task_data);
ast_mutex_lock(&std->lock);
std->complete = 1;
ast_cond_signal(&std->cond);
+ ret = std->fail;
ast_mutex_unlock(&std->lock);
- return std->fail;
+ return ret;
}
int ast_sip_push_task_synchronous(struct ast_taskprocessor *serializer, int (*sip_task)(void *), void *task_data)