From: Matthew Jordan Date: Fri, 7 Sep 2012 02:27:42 +0000 (+0000) Subject: Free ast_str objects when temp file fails to be created in MiniVM X-Git-Tag: 13.0.0-beta1~2565 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbdcee80f4b7652ed45367cd96e610761b8a136d;p=thirdparty%2Fasterisk.git 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 ........ Merged revisions 372582 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372583 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372584 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_minivm.c b/apps/app_minivm.c index 62b0488791..f2ee5ee7e0 100644 --- a/apps/app_minivm.c +++ b/apps/app_minivm.c @@ -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);