aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-19 20:33:03 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-19 20:33:03 +0000
commit2c5a088a6f2f68b533b6b704d9acca30320f0899 (patch)
tree6870a73b189704a1ec556678f902b84ebe313760 /apps
parentd0c38872d3ccacf839f1316c43401664f6fb6995 (diff)
Add a missing unlock in the case that memory allocation fails in app_chanspy.
Thanks to Russell for confirming that this was an issue. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@110083 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_chanspy.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 6152a74da..ee496f092 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -441,16 +441,15 @@ static struct chanspy_ds *setup_chanspy_ds(struct ast_channel *chan, struct chan
ast_mutex_lock(&chanspy_ds->lock);
- chanspy_ds->chan = chan;
-
if (!(datastore = ast_channel_datastore_alloc(&chanspy_ds_info, NULL))) {
+ ast_mutex_unlock(&chanspy_ds->lock);
chanspy_ds = chanspy_ds_free(chanspy_ds);
ast_channel_unlock(chan);
return NULL;
}
-
+
+ chanspy_ds->chan = chan;
datastore->data = chanspy_ds;
-
ast_channel_datastore_add(chan, datastore);
return chanspy_ds;