Re: memory leak

From: "Michael P(dot) Soulier" <michael_soulier(at)mitel(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: memory leak
Date: 2012-01-10 19:17:58
Message-ID: 20120110191758.GE8167@mitel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/01/12 Simon Riggs said:

> You're missing 2 PQclear() calls on success.
>
> http://www.postgresql.org/docs/devel/static/libpq-exec.html#LIBPQ-EXEC-MAIN

Ah, thanks.

Diffing db.c to db.c@@/main/soulierm_MASTeleworker_dev1/3
--- db.c@@/main/soulierm_MASTeleworker_dev1/3 2011-08-10 07:09:27.000000000
-0
400
+++ db.c 2012-01-10 14:15:21.070872000 -0500
@@ -39,6 +39,7 @@
PQclear(res);
exit_nicely(conn);
}
+ PQclear(res);

res = PQexec(conn, commandbuf);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
@@ -47,6 +48,7 @@
PQclear(res);
exit_nicely(conn);
}
+ PQclear(res);

/* end the transaction */
res = PQexec(conn, "END");

mps

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ralph Graulich 2012-01-10 19:29:32 (check) constraints on composite type
Previous Message Simon Riggs 2012-01-10 19:06:35 Re: memory leak