From: BJ Weschke Date: Mon, 1 May 2006 19:34:29 +0000 (+0000) Subject: Correct a condition from the prior patch that could happen in rare circumstances... X-Git-Tag: 1.2.8~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=822ea9615a60462f710235ce0be0b5047c05ee3f;p=thirdparty%2Fasterisk.git Correct a condition from the prior patch that could happen in rare circumstances and cause a core dump. Thanks Qwell! git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@23988 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index ba06a87cef..d720fb761b 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2599,7 +2599,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ if (txt && EXISTS(dir,msgnum,fn,chan->language)) { fclose(txt); rename(tmptxtfile, txtfile); - } else if (!EXISTS(dir,msgnum,fn,chan->language)) { + } else if (txt && !EXISTS(dir,msgnum,fn,chan->language)) { if (option_debug) ast_log(LOG_DEBUG, "The recorded media file is gone, so we should remove the .txt file too!\n"); fclose(txt);