]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix file descriptor leak and pointer scope issue in MiniVM when sending mail
authorMatthew Jordan <mjordan@digium.com>
Fri, 7 Sep 2012 02:09:36 +0000 (02:09 +0000)
committerMatthew Jordan <mjordan@digium.com>
Fri, 7 Sep 2012 02:09:36 +0000 (02:09 +0000)
commitca74dccd72b742560ec6f41f66609ebf3eaa5142
treef3bb5ca6d7f01d1a7246650f4abab1eb9afac312
parent3c13a80d5a7633824a2f950e183bf3e457f669cb
Fix file descriptor leak and pointer scope issue in MiniVM when sending mail

When MiniVM sends an e-mail and it has the volgain option set, it will spawn
sox in a separate process to handle the manipulation of the sound file.  In
doing so, it creates a temporary file.  There are two problems here:
  1) The file descriptor returned from mkstemp is leaked
  2) The finalfilename character pointer points to a buffer that loses scope
     once volgain processing is finished.

Note that in r316265, Russell fixed some gcc warnings by using the return
value of the mkstemp call.  A warning was placed in minivm that the file
descriptor was going to be leaked.  This patch reverts that change, as it
handles the leak and 'uses' the file descriptor returned from mkstemp.

(closes issue ASTERISK-17133)
Reported by: Tzafrir Cohen
patches:
  minivm_18501_demo.diff uploaded by Tzafrir Cohen (license #5035)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@372554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
apps/app_minivm.c