~singpolyma/biboumi

505deda1763137fd807e16586c8a2e1aa978c647 — louiz’ 6 years ago 4a2a280
Fix a memory leak when psql connection fails
1 files changed, 1 insertions(+), 0 deletions(-)

M src/database/postgresql_engine.cpp
M src/database/postgresql_engine.cpp => src/database/postgresql_engine.cpp +1 -0
@@ 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);