summaryrefslogtreecommitdiff
path: root/libpqpp/pq-prepared.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-10-08 16:58:13 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-10-08 16:58:13 +0100
commit78d8eeadcf6642eb52b3b178d6da620b0bb34289 (patch)
tree4777a94e6438b79e146754c58ad81a7b6d2a4118 /libpqpp/pq-prepared.cpp
parentFix virtual/override attribute use (diff)
downloadlibdbpp-postgresql-78d8eeadcf6642eb52b3b178d6da620b0bb34289.tar.bz2
libdbpp-postgresql-78d8eeadcf6642eb52b3b178d6da620b0bb34289.tar.xz
libdbpp-postgresql-78d8eeadcf6642eb52b3b178d6da620b0bb34289.zip
Use unique_ptr for execution results
Diffstat (limited to 'libpqpp/pq-prepared.cpp')
-rw-r--r--libpqpp/pq-prepared.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpqpp/pq-prepared.cpp b/libpqpp/pq-prepared.cpp
index bf8bd08..8678c11 100644
--- a/libpqpp/pq-prepared.cpp
+++ b/libpqpp/pq-prepared.cpp
@@ -26,8 +26,8 @@ PQ::PreparedStatement::prepare() const
}
std::stringstream psql;
prepareSql(psql, sql);
- c->checkResultFree(PQprepare(c->conn, stmntName.c_str(), std::move(psql).str().c_str(),
- static_cast<int>(values.size()), nullptr),
+ c->checkResult(PQprepare(c->conn, stmntName.c_str(), std::move(psql).str().c_str(), static_cast<int>(values.size()),
+ nullptr),
PGRES_COMMAND_OK);
return (pstmt = c->preparedStatements.insert({hash, stmntName}).first->second.c_str());
}