From cdfac31335ed2d108e657796bcd32caa04ae27e8 Mon Sep 17 00:00:00 2001
From: "Marc G. Fournier" <scrappy@hub.org>
Date: Wed, 18 Feb 1998 01:30:42 +0000
Subject: [PATCH] I'm getting a SEGV error when testing ecpg using the
 perftest,or any other, example program.

I have tracked this down to a call to PQfinish() in ECPGfinish()
that occurs before any connection is established.

From: Keith Parks <emkxp01@mtcc.demon.co.uk>
---
 src/interfaces/ecpg/lib/ecpglib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/interfaces/ecpg/lib/ecpglib.c b/src/interfaces/ecpg/lib/ecpglib.c
index 80e9b0fd9c4..9f5911c4774 100644
--- a/src/interfaces/ecpg/lib/ecpglib.c
+++ b/src/interfaces/ecpg/lib/ecpglib.c
@@ -24,7 +24,7 @@
 #include <libpq-fe.h>
 #include <libpq/pqcomm.h>
 
-static PGconn *simple_connection;
+static PGconn *simple_connection = NULL;
 static int	simple_debug = 0;
 static FILE *debugstream = NULL;
 static int	committed = true;
-- 
GitLab