]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix memory leak on DSM slot exhaustion.
authorThomas Munro <tmunro@postgresql.org>
Sat, 1 Feb 2020 01:29:13 +0000 (14:29 +1300)
committerThomas Munro <tmunro@postgresql.org>
Sat, 1 Feb 2020 01:57:40 +0000 (14:57 +1300)
commit93be45245272fc9f59caecc3db949b49b464a2a1
tree95651314ec28d0f2cd866148b9e740836c14d86d
parent742c646c198756ffb3fbe36c3c36715ca8048d77
Fix memory leak on DSM slot exhaustion.

If we attempt to create a DSM segment when no slots are available,
we should return the memory to the operating system.  Previously
we did that if the DSM_CREATE_NULL_IF_MAXSEGMENTS flag was
passed in, but we didn't do it if an error was raised.  Repair.

Back-patch to 9.4, where DSM segments arrived.

Author: Thomas Munro
Reviewed-by: Robert Haas
Reported-by: Julian Backes
Discussion: https://postgr.es/m/CA%2BhUKGKAAoEw-R4om0d2YM4eqT1eGEi6%3DQot-3ceDR-SLiWVDw%40mail.gmail.com
src/backend/storage/ipc/dsm.c