Fixed Coverity reported issue.

CID 11864: Wrapper object use after free (WRAPPER_ESCAPE)
Assigning: "szFilename" = "path.c_str()", which extracts wrapped state from local "path".
This commit is contained in:
Robert Osfield
2011-05-05 11:27:34 +00:00
parent ee9db5e5ba
commit 69e205b8a1

View File

@@ -893,9 +893,8 @@ std::string daeReader::processImagePath(const domImage* pDomImage) const
}
#ifdef WIN32
// If the path has a drive specifier or a UNC name then strip the leading /
const char* szFilename = path.c_str();
if (path.size() > 2 && (path[2] == ':' || (path[1] == '/' && path[2] == '/')))
return szFilename + 1;
return path.substr(1, std::string::npos);
#endif
return path;
}