From 3700a33e7ec5f01dfa18990fc7f055115f875b5e Mon Sep 17 00:00:00 2001 From: Ildar Hizbulin Date: Fri, 12 Sep 2014 19:51:59 +0400 Subject: [PATCH] Fix memory leak in the db_ido_pgsql module fixes #7195 Signed-off-by: Gunnar Beutner --- components/db_ido_pgsql/idopgsqlconnection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/db_ido_pgsql/idopgsqlconnection.cpp b/components/db_ido_pgsql/idopgsqlconnection.cpp index 6c76071fc..045c4f3cc 100644 --- a/components/db_ido_pgsql/idopgsqlconnection.cpp +++ b/components/db_ido_pgsql/idopgsqlconnection.cpp @@ -371,8 +371,10 @@ IdoPgsqlResult IdoPgsqlConnection::Query(const String& query) char *rowCount = PQcmdTuples(result); m_AffectedRows = atoi(rowCount); - if (PQresultStatus(result) == PGRES_COMMAND_OK) + if (PQresultStatus(result) == PGRES_COMMAND_OK) { + PQclear(result); return IdoPgsqlResult(); + } if (PQresultStatus(result) != PGRES_TUPLES_OK) { String message = PQresultErrorMessage(result); -- 2.40.0