Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'delete'