diff --git a/source/views/view_pattern.cpp b/source/views/view_pattern.cpp index 044f2c225..0b516f88b 100644 --- a/source/views/view_pattern.cpp +++ b/source/views/view_pattern.cpp @@ -62,8 +62,10 @@ namespace hex { size_t size = ftell(file); rewind(file); - if (size > 0xFF'FFFF) + if (size > 0xFF'FFFF) { + fclose(file); return; + } fread(this->m_buffer, size, 1, file);