Create memory context for tokenization after opening top-level file in hba.c

Michael Paquier <michael@paquier.xyz>

Commit: d46ad72f464beafa6d92d60d214412374559e280
Author: Michael Paquier <michael@paquier.xyz>
Date: 2022-11-24T01:27:38Z
Releases: 16.0
Create memory context for tokenization after opening top-level file in hba.c

The memory context was created before attempting to open the first HBA
or ident file, which would cause it to leak.  This had no consequences
for the system views for HBA and ident files, but this would cause
memory leaks in the postmaster on reload if the initial HBA and/or ident
files are missing, which is a valid behavior while the backend is
running.

Oversight in efc9816.

Author: Ted Yu
Discussion: https://postgr.es/m/CALte62xH6ivgiKKzPRJgfekPZC6FKLB3xbnf3=tZmc_gKj78dw@mail.gmail.com

Files

PathChange+/−
src/backend/libpq/hba.c modified +16 −16

Discussion