From: Anthony Minessale Date: Mon, 12 Sep 2011 21:38:48 +0000 (-0500) Subject: only unlink if file exists X-Git-Tag: v1.2-rc1~51^2~107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fb0f8e24f9b1619579e6a752db24ec33401da76;p=thirdparty%2Ffreeswitch.git only unlink if file exists --- diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index aa06fb6300..0b88532874 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -2848,7 +2848,7 @@ static switch_status_t deliver_vm(vm_profile_t *profile, failed: - if (del_file && file_path) { + if (del_file && file_path && switch_file_exists(file_path, pool)) { if (unlink(file_path) != 0) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", file_path); }