diff --git a/src/database/postgresql_engine.cpp b/src/database/postgresql_engine.cpp index 984a959..518c23a 100644 --- a/src/database/postgresql_engine.cpp +++ b/src/database/postgresql_engine.cpp @@ -34,6 +34,7 @@ std::unique_ptr PostgresqlEngine::open(const std::string& connin { const char* errmsg = PQerrorMessage(con); log_error("Postgresql connection failed: ", errmsg); + PQfinish(con); throw std::runtime_error("failed to open connection."); } return std::make_unique(con);