filesystem: fix possible NULL dereference

This commit is contained in:
Alibek Omarov 2024-04-04 18:41:22 +03:00
parent fed65dd497
commit f995d055b5
1 changed files with 6 additions and 0 deletions

View File

@ -320,6 +320,12 @@ public:
return nullptr; return nullptr;
state = new CSearchState( &searchHead, search ); state = new CSearchState( &searchHead, search );
if( !state )
{
Mem_Free( search );
return nullptr;
}
*handle = state->handle; *handle = state->handle;
return state->search->filenames[0]; return state->search->filenames[0];
} }