summaryrefslogtreecommitdiff
path: root/src/database/postgresql_statement.hpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-12-05 01:05:45 +0100
committerlouiz’ <louiz@louiz.org>2017-12-05 01:05:45 +0100
commitc3313d0d418cb2aaaf2226eb0a7729ef567b6afb (patch)
treec339752dec966574122a994e77c4f6ffd8d497c8 /src/database/postgresql_statement.hpp
parent24dc05dd979264143223e166faa032e75f986b21 (diff)
downloadbiboumi-c3313d0d418cb2aaaf2226eb0a7729ef567b6afb.tar.gz
biboumi-c3313d0d418cb2aaaf2226eb0a7729ef567b6afb.tar.bz2
biboumi-c3313d0d418cb2aaaf2226eb0a7729ef567b6afb.tar.xz
biboumi-c3313d0d418cb2aaaf2226eb0a7729ef567b6afb.zip
Always free the PGresult pointer returned by PQexec
Fix a somewhat big memory leak
Diffstat (limited to 'src/database/postgresql_statement.hpp')
-rw-r--r--src/database/postgresql_statement.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/database/postgresql_statement.hpp b/src/database/postgresql_statement.hpp
index 6e5dec8..30c3ec2 100644
--- a/src/database/postgresql_statement.hpp
+++ b/src/database/postgresql_statement.hpp
@@ -14,7 +14,10 @@ class PostgresqlStatement: public Statement
conn(conn)
{}
~PostgresqlStatement()
- {}
+ {
+ PQclear(this->result);
+ this->result = nullptr;
+ }
PostgresqlStatement(const PostgresqlStatement&) = delete;
PostgresqlStatement& operator=(const PostgresqlStatement&) = delete;
PostgresqlStatement(PostgresqlStatement&& other) = delete;