summaryrefslogtreecommitdiff
path: root/apps/app_voicemail.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2009-05-19 20:16:01 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2009-05-19 20:16:01 +0000
commitc1cb7b078e408217828d1f3e39ab0ae128e39cb7 (patch)
treee8343d58a5e1e038561ae12afec5e627ca2a21e8 /apps/app_voicemail.c
parent99a1e0ce01d0c60702136f617f92c795b3c91af6 (diff)
Merged revisions 195520 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r195520 | tilghman | 2009-05-19 15:12:20 -0500 (Tue, 19 May 2009) | 7 lines Ensure thread keys are initialized before attempting to access them. (closes issue #14889) Reported by: jaroth Patches: app_voicemail.c.patch uploaded by msirota (license 758) Tested by: msirota, BlargMaN ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_voicemail.c')
-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 cd556f615..07bd8aa19 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2571,6 +2571,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;
}
@@ -2598,6 +2599,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;
}
@@ -2633,6 +2635,7 @@ static struct vm_state *get_vm_state_by_mailbox(const char *mailbox, const char
if (interactive) {
struct vm_state *vms;
+ pthread_once(&ts_vmstate.once, ts_vmstate.key_init);
vms = pthread_getspecific(ts_vmstate.key);
return vms;
}