summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2013-09-04 02:04:31 -0500
committerRyan Houdek <Sonicadvance1@gmail.com>2013-09-04 02:04:31 -0500
commitd0d053a9f9fc3cc65704c5abd8a2a3c92b3f33ae (patch)
treea800236a6f082dca6691005e2056425a6cec1a0a /Source/Core/Common
parent1ea8b936676d5e0992a50cf4d0458658bf61978c (diff)
Fix for old libc version on bionic. Old versions would crash if the second argument was NULL.
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Src/CDUtils.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/Source/Core/Common/Src/CDUtils.cpp b/Source/Core/Common/Src/CDUtils.cpp
index 9a302b9189..f697476df5 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;
}