]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9714: [core] switch assert on attempted double close of a file handle
authorMike Jerris <mike@jerris.com>
Tue, 8 Nov 2016 19:22:35 +0000 (13:22 -0600)
committerMike Jerris <mike@jerris.com>
Tue, 8 Nov 2016 19:22:35 +0000 (13:22 -0600)
src/switch_core_file.c

index db8590f2a3cd241f543897c8ab8719894ba8b4b7..a1eea24ab34bc28d11135622ed3e7dac707b1244 100644 (file)
@@ -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;
        }