Re: BUG #16160: Minor memory leak in case of starting postgres server with SSL encryption
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jelte Fennema <postgres@jeltef.nl>
Cc: Michael Paquier <michael@paquier.xyz>, duspensky@ya.ru,
pgsql-bugs@lists.postgresql.org
Date: 2021-03-16T17:36:24Z
Lists: pgsql-bugs
Jelte Fennema <postgres@jeltef.nl> writes: > I'm pretty sure it was the only cause in this specific case. When running > postgres with valgrind this was the only block that was repeatedly being > leaked. Yeah, after doing some testing locally it seems that the non-error path, at least, is free of additional problems. I set up a shell loop to hit the postmaster with SIGHUP ten times a second. Looking at v12, an ssl-enabled postmaster leaks very visibly after a few moments; while there's no detectable leak in HEAD. So +1 for back-patching the DH_free fix. (Michael, do you want to do the honors?) > Looking at it again now, I see that if an error occurs when parsing > ssl_crl_file the root_cert_list is in fact leaked. This was easy to > reproduce by specifying a bogus path for ssl_crl_file. Interesting. While this case doesn't seem likely to pose much of a practical problem, maybe we should clean it up. I'd already wondered what was the point of separating the creation and use of the root_cert_list by so much --- seems like we could install it immediately after creation. regards, tom lane
Commits
-
Fix memory leak when rejecting bogus DH parameters.
- ad6c19066d93 10.17 landed
- 8c830148d2d4 11.12 landed
- 2f31414f4322 12.7 landed
- 4b41f6923458 13.3 landed
- e835e89a0fd2 14.0 landed
-
Fix memory leak when initializing DH parameters in backend
- c49e287a8e4d 11.12 landed
- 992cba94d38e 12.7 landed
- 7d9629ed2f69 10.17 landed
- e0e569e1d192 13.0 landed
-
Avoid corner-case memory leak in SSL parameter processing.
- 4b12ab18c9d0 14.0 landed
- a2764d87df04 11.12 landed
- 7ce7f2b79890 10.17 landed
- 6e34755560aa 12.7 landed
- 4d072bf2a031 13.3 landed