Skip to content

Commit

Permalink
Fix for old libc version on bionic. Old versions would crash if the s…
Browse files Browse the repository at this point in the history
…econd argument was NULL.
  • Loading branch information
Sonicadvance1 committed Sep 4, 2013
1 parent 1ea8b93 commit d0d053a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Source/Core/Common/Src/CDUtils.cpp
Expand Up @@ -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
Expand All @@ -234,11 +235,6 @@ bool cdio_is_cdrom(std::string device)
}
}

#ifdef __linux__
if (devname)
free(devname);
#endif

devices.clear();
return res;
}
Expand Down

0 comments on commit d0d053a

Please sign in to comment.