plug two memory leaks in USER-REAXC

This commit is contained in:
Axel Kohlmeyer
2016-03-19 22:32:02 -04:00
parent 30d1e018e1
commit 8bde015474
2 changed files with 4 additions and 2 deletions

View File

@ -367,7 +367,8 @@ void FixQEqReax::init_shielding()
int ntypes;
ntypes = atom->ntypes;
memory->create(shld,ntypes+1,ntypes+1,"qeq:shileding");
if (shld == NULL)
memory->create(shld,ntypes+1,ntypes+1,"qeq:shileding");
for( i = 1; i <= ntypes; ++i )
for( j = 1; j <= ntypes; ++j )

View File

@ -269,7 +269,8 @@ int FixReaxCSpecies::setmask()
void FixReaxCSpecies::setup(int vflag)
{
ntotal = static_cast<int> (atom->natoms);
memory->create(Name,ntypes,"reax/c/species:Name");
if (Name == NULL)
memory->create(Name,ntypes,"reax/c/species:Name");
post_integrate();
}