summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/database/postgresql_engine.cpp1
1 files changed, 1 insertions, 0 deletions
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<DatabaseEngine> 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<PostgresqlEngine>(con);