Don't memcpy null pointer
This commit is contained in:
@@ -54,8 +54,10 @@ void Alg_atoms::expand()
|
||||
maxlen += (maxlen >> 2); // add 25%
|
||||
char **new_atoms = new Alg_attribute[maxlen];
|
||||
// now do copy
|
||||
memcpy(new_atoms, atoms, len * sizeof(Alg_attribute));
|
||||
if (atoms) delete[] atoms;
|
||||
if (atoms) {
|
||||
memcpy(new_atoms, atoms, len * sizeof(Alg_attribute));
|
||||
delete[] atoms;
|
||||
}
|
||||
atoms = new_atoms;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user