diff options
Diffstat (limited to 'src/sql/drivers/psql')
-rw-r--r-- | src/sql/drivers/psql/qsql_psql.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index b75c9ee29c..fcf75af298 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -1421,8 +1421,10 @@ bool QPSQLDriver::subscribeToNotification(const QString &name) PGresult *result = d->exec(query); if (PQresultStatus(result) != PGRES_COMMAND_OK) { setLastError(qMakeError(tr("Unable to subscribe"), QSqlError::StatementError, d, result)); + PQclear(result); return false; } + PQclear(result); if (!d->sn) { d->sn = new QSocketNotifier(socket, QSocketNotifier::Read); @@ -1454,8 +1456,10 @@ bool QPSQLDriver::unsubscribeFromNotification(const QString &name) PGresult *result = d->exec(query); if (PQresultStatus(result) != PGRES_COMMAND_OK) { setLastError(qMakeError(tr("Unable to unsubscribe"), QSqlError::StatementError, d, result)); + PQclear(result); return false; } + PQclear(result); d->seid.removeAll(name); |