aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 17:27:55 +0000
committerautomerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 17:27:55 +0000
commit6afd7f30b7312fc1c6030f8368f6419c5f2f1672 (patch)
treecf1ad0e61bfa4f1f8b57b6c3d7922bb97f436b41 /channel.c
parentb16b17e312d90614edf4039e18b7ecc91d7cd9e2 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@67769 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/channel.c b/channel.c
index 4c71ce3f6..5a520db43 100644
--- a/channel.c
+++ b/channel.c
@@ -897,14 +897,16 @@ void ast_channel_free(struct ast_channel *chan)
last = cur;
cur = cur->next;
}
- if (!cur)
- ast_log(LOG_WARNING, "Unable to find channel in list\n");
- else {
- /* Lock and unlock the channel just to be sure nobody
- has it locked still */
- ast_mutex_lock(&cur->lock);
- ast_mutex_unlock(&cur->lock);
+ if (!cur) {
+ ast_mutex_unlock(&chlock);
+ ast_log(LOG_ERROR, "Unable to find channel in list to free. Assuming it has already been done.\n");
+ return;
}
+
+ /* Lock and unlock the channel just to be sure nobody
+ has it locked still */
+ ast_mutex_lock(&cur->lock);
+ ast_mutex_unlock(&cur->lock);
if (chan->tech_pvt) {
ast_log(LOG_WARNING, "Channel '%s' may not have been hung up properly\n", chan->name);
free(chan->tech_pvt);