diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-22 17:42:14 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-22 17:42:14 +0000 |
commit | ae5c80e1deeae11fa0f3478a6efa03e38971897f (patch) | |
tree | a3a0875ae4e73c9d9a1fc67f56ffa1ce73fe5457 /channels/chan_local.c | |
parent | 8f813d432c685f0b0c25e98261379b083263cf32 (diff) |
Merge major BSD mutex and symbol conflict patches (bug #1816) (link patch still pending)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3273 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rwxr-xr-x | channels/chan_local.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index 6421243d9..b4426825b 100755 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -87,6 +87,7 @@ retrylock: /* We had a glare on the hangup. Forget all this business, return and destroy p. */ ast_mutex_unlock(&p->lock); + ast_mutex_destroy(&p->lock); free(p); return -1; } @@ -271,6 +272,7 @@ static void local_destroy(struct local_pvt *p) prev->next = cur->next; else locals = cur->next; + ast_mutex_destroy(cur); free(cur); break; } @@ -324,8 +326,10 @@ static int local_hangup(struct ast_channel *ast) } ast_mutex_unlock(&locallock); /* And destroy */ - if (!glaredetect) + if (!glaredetect) { + ast_mutex_destroy(&p->lock); free(p); + } return 0; } if (p->chan && !p->launchedpbx) @@ -366,6 +370,7 @@ static struct local_pvt *local_alloc(char *data, int format) tmp->reqformat = format; if (!ast_exists_extension(NULL, tmp->context, tmp->exten, 1, NULL)) { ast_log(LOG_NOTICE, "No such extension/context %s@%s creating local channel\n", tmp->context, tmp->exten); + ast_mutex_destroy(&tmp->lock); free(tmp); tmp = NULL; } else { |