Do not attempt to PQclear a null PQresult*

This commit is contained in:
Sandro Santilli 2014-03-06 09:59:18 +01:00
parent 449e83fbf2
commit 2b2aead8b3

View file

@ -85,7 +85,7 @@ public:
PGresult *result = PQexec(conn_, sql.c_str());
bool ok = (result && (PQresultStatus(result) == PGRES_COMMAND_OK));
PQclear(result);
if ( result ) PQclear(result);
return ok;
}