Skip to content

Commit

Permalink
- strdup to allocate memory
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24547 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Feb 12, 2015
1 parent 8565fb8 commit 83d65d4
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -23,15 +23,15 @@ class ModelicaSimulationError: public std::runtime_error
{
public:
ModelicaSimulationError(SIMULATION_ERROR error_id,const std::string& error_info)
:runtime_error(error_info)
:runtime_error(strdup(error_info.c_str()))
,_error_id(error_id)
{
}
const char* what()
{
std::stringstream ss;
ss << "simulation error message : " << std::runtime_error::what();
return ss.str().c_str();
return strdup(ss.str().c_str());
}
SIMULATION_ERROR getErrorID()
{
Expand Down

0 comments on commit 83d65d4

Please sign in to comment.