aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_global.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/funcs/func_global.c b/funcs/func_global.c
index 1f88d0017..d97379ce9 100644
--- a/funcs/func_global.c
+++ b/funcs/func_global.c
@@ -109,8 +109,11 @@ static int shared_read(struct ast_channel *chan, const char *cmd, char *data, ch
} else
ast_channel_lock(chan);
- if (!(varstore = ast_channel_datastore_find(chan, &shared_variable_info, NULL)))
+ if (!(varstore = ast_channel_datastore_find(chan, &shared_variable_info, NULL))) {
+ ast_channel_unlock(chan);
return -1;
+ }
+
varshead = varstore->data;
*buf = '\0';
@@ -122,6 +125,8 @@ static int shared_read(struct ast_channel *chan, const char *cmd, char *data, ch
}
}
+ ast_channel_unlock(chan);
+
return 0;
}