From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Max Vaschenko <max(at)nino(dot)ru> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: postmaster grows |
Date: | 2001-02-07 23:46:06 |
Message-ID: | 6983.981589566@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Max Vaschenko <max(at)nino(dot)ru> writes:
> [ postmaster leaks memory when using password authentication ]
You are right! The postmaster leaks memory to the tune of a few dozen
bytes per password authentication attempt. I'm surprised no one noticed
this before. People must not be using password auth under heavy load...
Attached is a patch to fix it in 7.0.*.
regards, tom lane
*** src/backend/libpq/crypt.c.orig Sat Jul 17 16:17:01 1999
--- src/backend/libpq/crypt.c Wed Feb 7 18:40:01 2001
***************
*** 59,64 ****
--- 59,65 ----
bufsize = strlen(pwdfilename) + strlen(CRYPT_PWD_RELOAD_SUFX) + 1;
rpfnam = (char *) palloc(bufsize);
snprintf(rpfnam, bufsize, "%s%s", pwdfilename, CRYPT_PWD_RELOAD_SUFX);
+ pfree(pwdfilename);
return rpfnam;
}
***************
*** 79,84 ****
--- 80,87 ----
pwdfile = AllocateFile(filename, "rb");
#endif
+ pfree(filename);
+
return pwdfile;
}
***************
*** 131,136 ****
--- 134,140 ----
filename = crypt_getpwdreloadfilename();
result = unlink(filename);
+ pfree(filename);
/*
* We want to delete the flag file before reading the contents of the
From | Date | Subject | |
---|---|---|---|
Next Message | Yasuo Ohgaki | 2001-02-08 00:25:22 | Re: Create index problem ( _bt_sort ) |
Previous Message | Josh Berkus | 2001-02-07 22:52:48 | Bug Report for 7.1 Beta 3 |