diff --git a/filesystem/VFileSystem009.cpp b/filesystem/VFileSystem009.cpp index f906183f..6000bcce 100644 --- a/filesystem/VFileSystem009.cpp +++ b/filesystem/VFileSystem009.cpp @@ -320,6 +320,12 @@ public: return nullptr; state = new CSearchState( &searchHead, search ); + if( !state ) + { + Mem_Free( search ); + return nullptr; + } + *handle = state->handle; return state->search->filenames[0]; }