rstudio/rstudio — comment on commit 53eae785bd097a88d729bc82749e3078b64db3c2
File: src/cpp/core/system/Win32ChildProcess.cpp line 377
By jjallaire:

When you take a c_str from a string then the memory is not guaranteed to survive the destruction of the string. Since in this case the string is a temporary I think this c_str could become invalid immediately. You should have a std::string outside the if clause which holds the return from c_str.