Skip to content

Commit bb59845

Browse files
committed
Fix memory leak when an empty ident file is reloaded.
Hari Babu
1 parent 4d6d425 commit bb59845

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/libpq/hba.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,16 +2235,18 @@ load_ident(void)
22352235
}
22362236

22372237
/* Loaded new file successfully, replace the one we use */
2238-
if (parsed_ident_lines != NULL)
2238+
if (parsed_ident_lines != NIL)
22392239
{
22402240
foreach(parsed_line_cell, parsed_ident_lines)
22412241
{
22422242
newline = (IdentLine *) lfirst(parsed_line_cell);
22432243
if (newline->ident_user[0] == '/')
22442244
pg_regfree(&newline->re);
22452245
}
2246-
MemoryContextDelete(parsed_ident_context);
22472246
}
2247+
if (parsed_ident_context != NULL)
2248+
MemoryContextDelete(parsed_ident_context);
2249+
22482250
parsed_ident_context = ident_context;
22492251
parsed_ident_lines = new_parsed_lines;
22502252

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy