Do not attempt to PQclear a null PQresult*

This commit is contained in:
Sandro Santilli 2014-03-06 09:59:18 +01:00 committed by Dane Springmeyer
parent 749118cdee
commit ca9b0fccab

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;
}