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:
@ -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");
|
||||
|
||||
Reference in New Issue
Block a user