diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index dc0f87e17e..7a1f55b55f 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2593,8 +2593,10 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ ast_log(LOG_WARNING, "Error opening text file for output\n"); res = play_record_review(chan, NULL, fn, vmmaxmessage, fmt, 1, vmu, &duration, dir, options->record_gain); if (res == '0') { - if (txt) + if (txt) { fclose(txt); + rename(tmptxtfile, txtfile); + } goto transfer; } if (res > 0)