mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 19:29:24 +02:00
* Free postgres-results, fixed resource-leaking, probably fixes bug #13025
git-svn-id: trunk@12598 -
This commit is contained in:
parent
c07a60f8e0
commit
3ef9342d59
@ -544,6 +544,7 @@ begin
|
||||
begin
|
||||
if not tr.ErrorOccured then
|
||||
begin
|
||||
PQclear(res);
|
||||
res := pqexec(tr.PGConn,pchar('deallocate prepst'+nr));
|
||||
if (PQresultStatus(res) <> PGRES_COMMAND_OK) then
|
||||
begin
|
||||
@ -568,6 +569,7 @@ begin
|
||||
begin
|
||||
if FStatementType in [stInsert,stUpdate,stDelete,stSelect] then
|
||||
begin
|
||||
pqclear(res);
|
||||
if Assigned(AParams) and (AParams.count > 0) then
|
||||
begin
|
||||
setlength(ar,Aparams.count);
|
||||
@ -615,6 +617,8 @@ begin
|
||||
else
|
||||
s := Statement;
|
||||
res := pqexec(tr.PGConn,pchar(s));
|
||||
if (PQresultStatus(res) in [PGRES_COMMAND_OK,PGRES_TUPLES_OK]) then
|
||||
pqclear(res);
|
||||
end;
|
||||
if not (PQresultStatus(res) in [PGRES_COMMAND_OK,PGRES_TUPLES_OK]) then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user