diff options
author | Adrian Frühwirth | 2018-05-04 18:04:33 +0200 |
---|---|---|
committer | Adrian Frühwirth | 2018-05-05 17:54:46 +0200 |
commit | 88d4e5475d6541f8cc1bf5ddda81f2755ec06ba4 (patch) | |
tree | aab6d801fd8949d4971b9f1727a2af42338a558d /backends/saves | |
parent | 47ecb0b2e77de96755e259c43844d3f28f464d5b (diff) | |
download | scummvm-rg350-88d4e5475d6541f8cc1bf5ddda81f2755ec06ba4.tar.gz scummvm-rg350-88d4e5475d6541f8cc1bf5ddda81f2755ec06ba4.tar.bz2 scummvm-rg350-88d4e5475d6541f8cc1bf5ddda81f2755ec06ba4.zip |
PSP: Fix UB (use of deallocated memory)
Diffstat (limited to 'backends/saves')
-rw-r--r-- | backends/saves/psp/psp-saves.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/backends/saves/psp/psp-saves.cpp b/backends/saves/psp/psp-saves.cpp index 9d9affbc1b..ba09223884 100644 --- a/backends/saves/psp/psp-saves.cpp +++ b/backends/saves/psp/psp-saves.cpp @@ -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); |