[core] Do not try to close a file handle if it's not SWITCH_FILE_OPEN, return SWITCH_STATUS_FALSE instead

This commit is contained in:
Dragos Oancea 2019-11-11 23:18:23 +00:00 committed by Andrey Volk
parent a288c3d969
commit a2b46bcf10
1 changed files with 2 additions and 0 deletions

View File

@ -929,6 +929,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
if (switch_test_flag(fh, SWITCH_FILE_OPEN)) {
status = switch_core_file_pre_close(fh);
} else {
return SWITCH_STATUS_FALSE;
}
fh->file_interface->file_close(fh);