Re: BUG #1258: backend memory leak after massive 'CREATE/DROP USER'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Vadim Passynkov" <Vadim(dot)Passynkov(at)pathcom(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1258: backend memory leak after massive 'CREATE/DROP USER'
Date: 2004-09-18 01:24:53
Message-ID: 27731.1095470693@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org> writes:
> Description: backend memory leak after massive 'CREATE/DROP USER'

Actually postmaster memory leak, but good catch anyway --- thanks!
The patch against 7.4 is

Index: hba.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/libpq/hba.c,v
retrieving revision 1.116.2.2
diff -c -r1.116.2.2 hba.c
*** hba.c 25 May 2004 19:11:26 -0000 1.116.2.2
--- hba.c 18 Sep 2004 01:16:18 -0000
***************
*** 168,173 ****
--- 168,176 ----
* Tokenize file and handle file inclusion and comma lists. We have
* to break apart the commas to expand any file names then
* reconstruct with commas.
+ *
+ * The result is always a palloc'd string. If it's zero-length then
+ * we have reached EOL.
*/
static char *
next_token_expand(FILE *file)
***************
*** 333,338 ****
--- 336,343 ----
{
/* we are at real or logical EOL, so force a new line List */
next_line = NIL;
+ /* Don't forget to pfree the next_token_expand result */
+ pfree(buf);
}

/* Advance line number whenever we reach EOL */

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message stig erikson 2004-09-18 07:15:36 Re: BUG #1257: add support for 1-byte integer and 4-bit integer
Previous Message John R Pierce 2004-09-18 00:42:52 Re: BUG #1258: backend memory leak after massive 'CREATE/DROP USER'