diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_chanspy.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index f37de3889..66a2d214e 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -478,16 +478,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; |