Skip to content
Snippets Groups Projects
Commit 72881e57 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[CL] Use std::vector replacing raw pointer

The raw pointer might be not deallocated.
parent e649c352
No related branches found
No related tags found
No related merge requests found
......@@ -144,9 +144,7 @@ void PhreeqcKernel::loadDatabase(std::string const& database)
void PhreeqcKernel::reinitializeRates()
{
count_rates = _reaction_rates.size();
rates = (struct rate*)realloc(
rates, (std::size_t)(count_rates) * sizeof(struct rate));
std::vector<struct rate> rates(_reaction_rates.size());
int rate_id = 0;
for (auto const& reaction_rate : _reaction_rates)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment