fix two memory allocation/deallocation bugs in pair style comb3
This commit is contained in:
@ -594,9 +594,9 @@ void PairComb3::read_file(char *file)
|
||||
int params_per_line = 74;
|
||||
char **words = new char*[params_per_line+1];
|
||||
|
||||
if (params) delete [] params;
|
||||
memory->sfree(params);
|
||||
params = NULL;
|
||||
nparams = 0;
|
||||
nparams = maxparam = 0;
|
||||
|
||||
// open file on proc 0
|
||||
|
||||
@ -656,9 +656,9 @@ void PairComb3::read_file(char *file)
|
||||
if ((ptr = strchr(line,'#'))) *ptr = '\0';
|
||||
nwords = atom->count_words(line);
|
||||
}
|
||||
if (nwords != params_per_line){
|
||||
if (nwords != params_per_line) {
|
||||
error->all(FLERR,"Incorrect format in COMB3 potential file");
|
||||
}
|
||||
}
|
||||
// words = ptrs to all words in line
|
||||
|
||||
nwords = 0;
|
||||
|
||||
Reference in New Issue
Block a user