From 2b2aead8b3a3243349d80cde63c25aa68e3b8ad8 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 6 Mar 2014 09:59:18 +0100 Subject: [PATCH] Do not attempt to PQclear a null PQresult* --- plugins/input/postgis/connection.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/input/postgis/connection.hpp b/plugins/input/postgis/connection.hpp index c725ab91a..d5fc1460a 100644 --- a/plugins/input/postgis/connection.hpp +++ b/plugins/input/postgis/connection.hpp @@ -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; }