From a2b46bcf109d92e97b925aebeeea4d13a99e6267 Mon Sep 17 00:00:00 2001 From: Dragos Oancea Date: Mon, 11 Nov 2019 23:18:23 +0000 Subject: [PATCH] [core] Do not try to close a file handle if it's not SWITCH_FILE_OPEN, return SWITCH_STATUS_FALSE instead --- src/switch_core_file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/switch_core_file.c b/src/switch_core_file.c index a009f5b19b..c49b151b01 100644 --- a/src/switch_core_file.c +++ b/src/switch_core_file.c @@ -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); -- 2.47.2