Re: memory leak
| От | Michael P. Soulier |
|---|---|
| Тема | Re: memory leak |
| Дата | |
| Msg-id | 20120110191758.GE8167@mitel.com обсуждение исходный текст |
| Ответ на | Re: memory leak (Simon Riggs <simon@2ndQuadrant.com>) |
| Список | 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
В списке pgsql-general по дате отправления: