Fix memory leak in the db_ido_pgsql module

fixes #7195

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
This commit is contained in:
Ildar Hizbulin 2014-09-12 19:51:59 +04:00 committed by Gunnar Beutner
parent ac32d4b382
commit 3700a33e7e
1 changed files with 3 additions and 1 deletions

View File

@ -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);