Skip to content

Commit

Permalink
[NewSimulationRuntimec] - added ASSERTS for calloc
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10476 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Nov 12, 2011
1 parent f0bc1d0 commit 8a02249
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions SimulationRuntime/c/simulation/solver/solver_main.c
Expand Up @@ -617,12 +617,18 @@ dasrt_step(double step, double start, double stop, int trigger1,
lrw = 52 + (MAXORD + 4) * globalData->nStates + globalData->nStates
* globalData->nStates + 3 * globalData->nZeroCrossing;
rwork = (double*) calloc(lrw,sizeof(double));
ASSERT(rwork,"out of memory");
iwork = (fortran_integer*) calloc(liw,sizeof(fortran_integer));
ASSERT(rwork,"out of memory");
jroot = (fortran_integer*) calloc(globalData->nZeroCrossing,sizeof(fortran_integer));
ASSERT(rwork,"out of memory");
/* Used when calculating residual for its side effects. (alg. var calc) */
dummy_delta = (double*) calloc(globalData->nStates,sizeof(double));
ASSERT(rwork,"out of memory");
rpar = (double*) calloc(1,sizeof(double));
ASSERT(rwork,"out of memory");
ipar = (fortran_integer*) calloc(3,sizeof(fortran_integer));
ASSERT(rwork,"out of memory");
ipar[0] = sim_verbose;
ipar[1] = LOG_JAC;
ipar[2] = LOG_ENDJAC;
Expand Down

0 comments on commit 8a02249

Please sign in to comment.