]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 372582 via svnmerge from
authorAutomerge script <automerge@asterisk.org>
Fri, 7 Sep 2012 03:24:26 +0000 (03:24 +0000)
committerAutomerge script <automerge@asterisk.org>
Fri, 7 Sep 2012 03:24:26 +0000 (03:24 +0000)
file:///srv/subversion/repos/asterisk/branches/10

................
  r372582 | mjordan | 2012-09-06 21:25:36 -0500 (Thu, 06 Sep 2012) | 13 lines

  Free ast_str objects when temp file fails to be created in MiniVM

  The previous commit (r372554) was from a patch that was written before
  r366880, which ensured that ast_str objects allocated in the sendmail
  routine were free'd in off nominal paths.  This commit frees the
  string objects in the off nominal path introduced in r372554.

  (issue ASTERISK-17133)
  Reported by: Tzafrir Cohen
  ........

  Merged revisions 372581 from http://svn.asterisk.org/svn/asterisk/branches/1.8
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@372607 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_minivm.c

index d40246cdcb9d95d8865009857991a1e07f79bdcd..d0cc8b75ffc2164005cbc731f56a5dfc495ca03b 100644 (file)
@@ -1277,6 +1277,8 @@ static int sendmail(struct minivm_template *template, struct minivm_account *vmu
                tmpfd = mkstemp(newtmp);
                if (tmpfd < 0) {
                        ast_log(LOG_WARNING, "Failed to create temporary file for volgain: %d\n", errno);
+                       ast_free(str1);
+                       ast_free(str2);
                        return -1;
                }
                snprintf(tmpcmd, sizeof(tmpcmd), "sox -v %.4f %s.%s %s.%s", vmu->volgain, filename, format, newtmp, format);