diff options
Diffstat (limited to 'connectivity/source/drivers/postgresql/pq_connection.cxx')
-rw-r--r-- | connectivity/source/drivers/postgresql/pq_connection.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx index 0e196d302e6d..74afc570154d 100644 --- a/connectivity/source/drivers/postgresql/pq_connection.cxx +++ b/connectivity/source/drivers/postgresql/pq_connection.cxx @@ -403,12 +403,13 @@ public: ~cstr_vector () { OSL_ENSURE(values.size() == acquired.size(), "pq_connection: cstr_vector values and acquired size mismatch"); - std::vector<char*>::iterator pv = values.begin(); std::vector<bool>::const_iterator pa = acquired.begin(); - const std::vector<char*>::const_iterator pve = values.end(); - for( ; pv != pve ; ++pv, ++pa ) + for( const auto& v : values ) + { if (*pa) - free(*pv); + free(v); + ++pa; + } } void push_back(const char* s, __sal_NoAcquire) { |