From c6971c66bb3c893a37b45e87b5be1e0dec84103e Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 19 Feb 2019 19:26:42 +0100 Subject: [PATCH] Call PQfinish() when PostgreSQL connection failed to initialize. Closes #544. --- source/dbconnection.pas | 1 + 1 file changed, 1 insertion(+) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index 22faa300..45668b52 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -2083,6 +2083,7 @@ begin Error := LastErrorMsg; Log(lcError, Error); FConnectionStarted := 0; + PQfinish(FHandle); // free the memory FHandle := nil; raise EDatabaseError.Create(Error); end;