aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/app_voicemail.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 6bd8a4d18..3467b6c4a 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2149,6 +2149,7 @@ static struct vm_state *create_vm_state_from_user(struct ast_vm_user *vmu)
{
struct vm_state *vms_p;
+ pthread_once(&ts_vmstate.once, ts_vmstate.key_init);
if ((vms_p = pthread_getspecific(ts_vmstate.key)) && !strcmp(vms_p->imapuser, vmu->imapuser) && !strcmp(vms_p->username, vmu->mailbox)) {
return vms_p;
}
@@ -2175,6 +2176,7 @@ static struct vm_state *get_vm_state_by_imapuser(const char *user, int interacti
if (interactive) {
struct vm_state *vms;
+ pthread_once(&ts_vmstate.once, ts_vmstate.key_init);
vms = pthread_getspecific(ts_vmstate.key);
return vms;
}
@@ -2209,6 +2211,7 @@ static struct vm_state *get_vm_state_by_mailbox(const char *mailbox, int interac
if (interactive) {
struct vm_state *vms;
+ pthread_once(&ts_vmstate.once, ts_vmstate.key_init);
vms = pthread_getspecific(ts_vmstate.key);
return vms;
}