diff --git a/Source/Core/Common/Src/CDUtils.cpp b/Source/Core/Common/Src/CDUtils.cpp index 9a302b9189b8..f697476df560 100644 --- a/Source/Core/Common/Src/CDUtils.cpp +++ b/Source/Core/Common/Src/CDUtils.cpp @@ -214,7 +214,8 @@ bool cdio_is_cdrom(std::string device) #ifdef __linux__ // Resolve symbolic links. This allows symbolic links to valid // drives to be passed from the command line with the -e flag. - char *devname = realpath(device.c_str(), NULL); + char resolved_path[MAX_PATH]; + char *devname = realpath(device.c_str(), resolved_path); if (!devname) return false; #endif @@ -234,11 +235,6 @@ bool cdio_is_cdrom(std::string device) } } -#ifdef __linux__ - if (devname) - free(devname); -#endif - devices.clear(); return res; }