From: Mike Jerris Date: Tue, 8 Nov 2016 19:22:35 +0000 (-0600) Subject: FS-9714: [core] switch assert on attempted double close of a file handle X-Git-Tag: v1.8.0~1118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e332c1a24cfec034a5134a12c35c2f892a9967b0;p=thirdparty%2Ffreeswitch.git FS-9714: [core] switch assert on attempted double close of a file handle --- diff --git a/src/switch_core_file.c b/src/switch_core_file.c index db8590f2a3..a1eea24ab3 100644 --- a/src/switch_core_file.c +++ b/src/switch_core_file.c @@ -780,9 +780,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh) switch_status_t status; switch_assert(fh != NULL); - switch_assert(fh->file_interface != NULL); - if (!switch_test_flag(fh, SWITCH_FILE_OPEN)) { + if (!fh->file_interface || !switch_test_flag(fh, SWITCH_FILE_OPEN)) { return SWITCH_STATUS_FALSE; }