aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-19 20:17:10 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-19 20:17:10 +0000
commitb56ce985bb202ed42878403b378d034cd5f934a3 (patch)
tree4a87a94cca6d71bfa74952b0e9c65149ea1b655e /apps
parenta2bf476cdb888f6240388e7091fb7f756ac91937 (diff)
Merged revisions 195521 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r195521 | tilghman | 2009-05-19 15:16:01 -0500 (Tue, 19 May 2009) | 14 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.0@195522 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-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;
}