]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
only unlink if file exists
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 12 Sep 2011 21:38:48 +0000 (16:38 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 12 Sep 2011 21:38:48 +0000 (16:38 -0500)
src/mod/applications/mod_voicemail/mod_voicemail.c

index aa06fb6300b2ea9e75150a1ff3067835a95e561a..0b88532874c88effb440431480c956a9e15712c7 100644 (file)
@@ -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);
                }