zero out additionally allocated struct Param storage

This commit is contained in:
Axel Kohlmeyer
2020-07-09 00:31:08 -04:00
parent 8359a4384a
commit e42342ff51
24 changed files with 119 additions and 0 deletions

View File

@ -957,6 +957,11 @@ void PairEDIP::read_file(char *file)
maxparam += DELTA;
params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
"pair:params");
// make certain all addional allocated storage is initialized
// to avoid false positives when checking with valgrind
memset(params + nparams, 0, DELTA*sizeof(Param));
}
params[nparams].ielement = ielement;