Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb59845

Browse files
committed
Fix memory leak when an empty ident file is reloaded.
Hari Babu
1 parent4d6d425 commitbb59845

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)

[8]ページ先頭

©2009-2025 Movatter.jp