Skip to content

Commit

Permalink
Avoid double PQfinish(), just in case. (#780)
Browse files Browse the repository at this point in the history
I _think_ `PQfinish()` simply does nothing if you pass it a `nullptr`.
But I don't actually see that documented anywhere, so...
  • Loading branch information
jtv committed Jan 1, 2024
1 parent bef5d96 commit d8b6b99
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/connection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,8 @@ pqxx::result pqxx::connection::exec_prepared(

void pqxx::connection::close()
{
// Just in case PQfinish() doesn't handle nullptr nicely.
if (m_conn == nullptr) return;
try
{
if (m_trans)
Expand Down

0 comments on commit d8b6b99

Please sign in to comment.