Explicitly set the pValue pointer to NULL.

PyTuple_SetItem “steals” a reference to pValue, but
does not set it to NULL after dereferencing it. It
causes segmentation fault when running lammps on some
systems and on multiple processors since it is trying
to decrement the reference count for an object which
does not exist.
This commit is contained in:
yafshar
2020-05-27 09:29:18 -05:00
parent 5e3fe19756
commit 4d237f6640

View File

@ -464,7 +464,8 @@ void kimProperty::command(int narg, char **arg)
error->one(FLERR, "Error Python `kim_property_dump` function "
"evaluation failed!");
}
}
} else
pValue = NULL;
// Destroy the variable
kim_str_cmd[1] = const_cast<char *>("delete");