From f995d055b590a39a824f2039eae9a5aae825e354 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 4 Apr 2024 18:41:22 +0300 Subject: [PATCH] filesystem: fix possible NULL dereference --- filesystem/VFileSystem009.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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]; }