From 01439e25d844b3169fa61c2527b4af5c948a2e65 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 24 Feb 2020 23:48:47 +0100 Subject: [PATCH] do not segv if there is no postgres --- src/pq/test_pq.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pq/test_pq.c b/src/pq/test_pq.c index 7bcb10980..b09354af8 100644 --- a/src/pq/test_pq.c +++ b/src/pq/test_pq.c @@ -238,6 +238,12 @@ main (int argc, NULL, es, NULL); + if (NULL == db) + { + fprintf (stderr, + "Cannot run test, database connection failed\n"); + return 77; + } if (CONNECTION_OK != PQstatus (db->conn)) { fprintf (stderr, -- 2.25.1