Skip to content

Commit

Permalink
PSP: Fix UB (use of deallocated memory)
Browse files Browse the repository at this point in the history
  • Loading branch information
bonki committed May 5, 2018
1 parent 47ecb0b commit 88d4e54
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backends/saves/psp/psp-saves.cpp
Expand Up @@ -60,16 +60,15 @@ PSPSaveFileManager::PSPSaveFileManager(const Common::String &defaultSavepath)
*/

void PSPSaveFileManager::checkPath(const Common::FSNode &dir) {
const char *savePath = dir.getPath().c_str();
clearError();

PowerMan.beginCriticalSection();

//check if the save directory exists
SceUID fd = sceIoDopen(savePath);
SceUID fd = sceIoDopen(dir.getPath().c_str());
if (fd < 0) {
//No? then let's create it.
sceIoMkdir(savePath, 0777);
sceIoMkdir(dir.getPath().c_str(), 0777);
} else {
//it exists, so close it again.
sceIoDclose(fd);
Expand Down

0 comments on commit 88d4e54

Please sign in to comment.