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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@195526
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
{
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;
}
if (interactive) {
struct vm_state *vms;
+ pthread_once(&ts_vmstate.once, ts_vmstate.key_init);
vms = pthread_getspecific(ts_vmstate.key);
return vms;
}
if (interactive) {
struct vm_state *vms;
+ pthread_once(&ts_vmstate.once, ts_vmstate.key_init);
vms = pthread_getspecific(ts_vmstate.key);
return vms;
}