must initialize deleted pointers to null since the following commands may fail
This commit is contained in:
@ -332,6 +332,8 @@ void Update::create_integrate(int narg, char **arg, int trysuffix)
|
||||
|
||||
delete[] integrate_style;
|
||||
delete integrate;
|
||||
integrate_style = nullptr;
|
||||
integrate = nullptr;
|
||||
|
||||
int sflag;
|
||||
|
||||
@ -400,6 +402,8 @@ void Update::create_minimize(int narg, char **arg, int trysuffix)
|
||||
|
||||
delete[] minimize_style;
|
||||
delete minimize;
|
||||
minimize_style = nullptr;
|
||||
minimize = nullptr;
|
||||
|
||||
// temporarily assign the style name without suffix (for error messages during creation)
|
||||
minimize_style = arg[0];
|
||||
|
||||
Reference in New Issue
Block a user