app_voicemail/IMAP: check mailstream not NULL in leave_voicemail
authorAlexei Gradinari <alex2grad@gmail.com>
Wed, 14 Aug 2019 19:52:01 +0000 (15:52 -0400)
committerAlexei Gradinari <alex2grad@gmail.com>
Thu, 15 Aug 2019 14:47:24 +0000 (09:47 -0500)
commit15624d9a7af1424480aa9dab217d0c381fa12bd3
tree0aa1957e000d6f0c328e8382d383101c33116bb7
parente40f248faca71a29dcf12cc2849bf41d9c054c22
app_voicemail/IMAP: check mailstream not NULL in leave_voicemail

The function leave_voicemail checks if expungeonhangup is set,
but does not check if IMAP stream is closed,
so it could call imap function with NULL stream.
This leads to segfault.

ASTERISK-28505 #close

Change-Id: Ib66c57c1f1ba97774e447b36349198e2626a8d7c
apps/app_voicemail.c