voicemail: Fix various abuses of mkstemp
authorSean Bright <sean.bright@gmail.com>
Fri, 25 Aug 2017 18:44:35 +0000 (14:44 -0400)
committerSean Bright <sean.bright@gmail.com>
Fri, 25 Aug 2017 21:08:55 +0000 (16:08 -0500)
commitda13cdb9e7e402633240c32ca24193952c4b1867
treed43e3d25d78954708721147ca5f948c3fc4e4ab2
parent179524c255c11fc48dff7092e5814f6fa8a0336b
voicemail: Fix various abuses of mkstemp

mkstemp() returns a unique filename, but appending an extension to that
filename does not guarantee uniqueness. Instead, use mkdtemp() and we
can put whatever extension we want on the files that we create inside
the directory.

In the case of app_minivm, we also now properly clean up any temporary
files that we create.

ASTERISK-20858 #close
Reported by: Walter Doekes

Change-Id: I30ad04f0e115f0b11693ff678ba5184d8b938e43
apps/app_minivm.c
apps/app_voicemail.c